View Javadoc

1   package com.loribel.commons.abstraction;
2   
3   /***
4    * Abstraction to represent a hierarchy.
5    * A SimpleNode is a abstraction that :
6    *   - has a value
7    *   - has a labelIcon representation
8    *   - may has children
9    * <br />
10   * An other abstraction with setter exists : {@link GB_SimpleNodeSet}.
11   * See the default implementation :
12   *   - {@link com.loribel.commons.util.impl.GB_SimpleNodeAbstract}
13   *   - {@link com.loribel.commons.util.impl.GB_SimpleNodeImpl}
14   *   - {@link com.loribel.commons.file.GB_FileSimpleNode}
15   *
16   * @author Grégory Borelli
17   */
18  public interface GB_SimpleNode
19          extends
20              GB_LabelIconOwner
21  {
22      /***
23       * Return the value of this node.
24       *
25       * @return Object
26       */
27      Object getValue();
28  
29      /***
30       * Return the child with index i.
31       *
32       * @param a_index int -
33       *
34       * @return GB_SimpleNode
35       */
36      GB_SimpleNode getChildAt(
37              int a_index);
38  
39      /***
40       * Return the count of the children.
41       *
42       * @return int
43       */
44      int getChildCount();
45  
46      /***
47       * Return an array of the children.
48       *
49       * @return GB_SimpleNode[]
50       */
51      GB_SimpleNode[] getChildArray();
52  
53      /***
54       * Return the last child.
55       *
56       * @return GB_SimpleNode
57       */
58      GB_SimpleNode getLastChild();
59  
60      /***
61       * Return the last child for level a_level.
62       * If level = 1 return the last child of this node.
63       *
64       * @param a_level int - the level must be equal or superior than 1
65       *
66       * @return GB_SimpleNode
67       */
68      GB_SimpleNode getLastChild(
69              int a_level);
70  
71  }