Andrew Brown | 388c51d | 2016-09-09 17:56:48 -0700 | [diff] [blame] | 1 | /* |
| 2 | * jndn-utils |
| 3 | * Copyright (c) 2016, Intel Corporation. |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it |
| 6 | * under the terms and conditions of the GNU Lesser General Public License, |
| 7 | * version 3, as published by the Free Software Foundation. |
| 8 | * |
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT ANY |
| 10 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 11 | * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for |
| 12 | * more details. |
| 13 | */ |
| 14 | |
| 15 | package com.intel.jndn.utils; |
| 16 | |
| 17 | import net.named_data.jndn.Name; |
| 18 | |
| 19 | import java.util.Collection; |
| 20 | import java.util.Optional; |
| 21 | |
| 22 | /** |
| 23 | * @author Andrew Brown, andrew.brown@intel.com |
| 24 | */ |
| 25 | public interface NameTree<T> { |
| 26 | Optional<T> content(); |
| 27 | |
| 28 | Name.Component lastComponent(); |
| 29 | |
| 30 | Name fullName(); |
| 31 | |
| 32 | Collection<NameTree<T>> children(); |
| 33 | |
| 34 | NameTree<T> parent(); |
| 35 | |
| 36 | NameTree<T> insert(Name name, T content); |
| 37 | |
| 38 | Optional<NameTree<T>> find(Name query); |
| 39 | |
| 40 | Optional<NameTree<T>> delete(Name name); |
| 41 | |
| 42 | int count(); |
| 43 | |
| 44 | void clear(); |
| 45 | } |