|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
NODE
- is the generic type for self-references. Each sub-type of this
interface should specialize this type to itself. End-users should
simply use an unbound wildcard (TreeNode
<?>
).public interface TreeNode<NODE extends TreeNode<NODE>>
This is the interface for the node a tree. The tree itself is defined by the
root-node which is its only node
in the tree that
has no parent
.
Method Summary | |
---|---|
List<NODE> |
getChildren()
This method gets the List containing all children of this
TreeNode . |
NODE |
getParent()
This method gets the parent of this TreeNode . |
boolean |
isAncestor(TreeNode<?> node)
This method determines if this TreeNode is an ancestor of the given
node . |
boolean |
isDescendant(TreeNode<?> node)
This method determines if this TreeNode is a descendant of the
given node . |
Method Detail |
---|
NODE getParent()
TreeNode
.
TreeNode
or null
if this is the
root- TreeNode
.List<NODE> getChildren()
List
containing all children of this
TreeNode
. The List
may be empty
- in
such case we call this TreeNode
a leaf. Each item of the
returned List
is called a child or child-node. It
should return this TreeNode
as parent
.
List
containing all children of this TreeNode
.boolean isDescendant(TreeNode<?> node)
TreeNode
is a descendant of the
given node
. In other words this method checks if this
TreeNode
is the direct or indirect child
of
the given node
.
node
- is the TreeNode
to check (the potential
ancestor
).
true
if this TreeNode
is an descendant of the
given node
.boolean isAncestor(TreeNode<?> node)
TreeNode
is an ancestor of the given
node
. In other words this method checks if this
TreeNode
is the direct or indirect parent
of
the given node
.
node
- is the TreeNode
to check (the potential
descendant
).
true
if this TreeNode
is an ancestor of the
given node
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |