annotate src/treecms/api/Node.java @ 6:12604eb6b615

added javadoc
author shoshi
date Mon, 14 Mar 2011 23:24:38 +0900 (2011-03-14)
parents f5ed85be5640
children fc19e38b669b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7ecb9273581d hg init
shoshi
parents:
diff changeset
1 package treecms.api;
7ecb9273581d hg init
shoshi
parents:
diff changeset
2
6
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
3 import java.util.List;
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
4 import java.util.Map;
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
5
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
6 /**
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
7 * 木構造の基本のデータ単位であるNodeを示します.Nodeは子供のリストとデータのマップを保持します.また,クライアントはノードが保持しているデータをNodeDataとして
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
8 * 取得することが出来ます.
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
9 * @author shoshi
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
10 */
2
4a5ee88f02cf added OnMemoryForest
shoshi
parents: 1
diff changeset
11 public interface Node
0
7ecb9273581d hg init
shoshi
parents:
diff changeset
12 {
6
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
13 /**
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
14 * Nodeに対応するNodeIDを取得します.
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
15 * @return
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
16 */
0
7ecb9273581d hg init
shoshi
parents:
diff changeset
17 public NodeID getID();
6
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
18
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
19 /**
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
20 * Nodeが保持するデータを取得します
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
21 * @return Nodeが保持するNodeData
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
22 */
1
bdde898e8ef9 add Forest
shoshi
parents: 0
diff changeset
23 public NodeData getData();
6
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
24
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
25 /**
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
26 * Nodeが属するForestを取得します.
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
27 * @return Nodeが属するForest
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
28 */
2
4a5ee88f02cf added OnMemoryForest
shoshi
parents: 1
diff changeset
29 public Forest getForest();
6
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
30
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
31 /**
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
32 * 子供Nodeのリストを取得します..
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
33 * @return 子供Nodeのリスト
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
34 */
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
35 public List<Node> children();
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
36
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
37 /**
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
38 * このNodeが保持するデータをマップとしてすべて取得します.
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
39 * @return Nodeが保持するすべてのデータのマップ
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
40 */
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
41 public Map<byte[],byte[]> getAll();
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
42
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
43 /**
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
44 * このNodeが保持する値の中で指定されたキーと対応する値を取得します.
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
45 * @param _key データに対応するキー
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
46 * @return キーと対応する値,見つからない場合はnull
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
47 */
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
48 public byte[] get(byte[] _key);
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
49
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
50 /**
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
51 * 指定されたリストに含まれるNodeを,すべて子供Nodeとして追加します.
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
52 * @param _children 追加される子供Nodeを保持するリスト
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
53 */
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
54 public void addAll(List<Node> _children);
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
55
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
56 /**
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
57 * 指定されたNodeを子供Nodeとして追加します.
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
58 * @param _child
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
59 */
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
60 public void add(Node _child);
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
61
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
62 /**
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
63 * キーとそれに対応する値を保存します.キーが重複した場合は上書きされます.
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
64 * @param _key キー
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
65 * @param _value 値
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
66 */
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
67 public void put(byte[] _key,byte[] _value);
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
68
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
69 /**
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
70 * キーとそれに対応する値を複数保持するマップを引数としてとり,マップが保持する値をすべて追加します.
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
71 * @param _map 追加される値のマップ
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
72 */
12604eb6b615 added javadoc
shoshi
parents: 4
diff changeset
73 public void putAll(Map<byte[],byte[]> _map);
0
7ecb9273581d hg init
shoshi
parents:
diff changeset
74 }