blob: 8ae4fcc350ed8a25b7b54f4d7ef4d88d0f95bce6 [file] [log] [blame]
Andrew Brown388c51d2016-09-09 17:56:48 -07001/*
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
15package com.intel.jndn.utils;
16
17import net.named_data.jndn.Name;
18
19import java.util.Collection;
20import java.util.Optional;
21
22/**
23 * @author Andrew Brown, andrew.brown@intel.com
24 */
25public 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}