|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.Tree.Entry<E>
public static class Tree.Entry<E>
Represents an entry for a node in the tree. The entry contains information about the parent and child nodes, and the depth of the entry within the tree.
Field Summary | |
---|---|
private List<Tree.Entry<E>> |
children
|
private int |
depth
|
private E |
node
|
private Tree.Entry<E> |
parent
|
private Tree<E> |
tree
|
Constructor Summary | |
---|---|
private |
Tree.Entry(Tree<E> tree,
E node,
Tree.Entry<E> parent)
|
Method Summary | |
---|---|
Tree.Entry<E> |
addChild(E child)
Add a child to the node. |
private void |
addChildEntry(Tree.Entry<E> child)
|
List<Tree.Entry<E>> |
getChildren()
Get the list of entries for the children to this node. |
int |
getDepth()
Get the depth of this entry within the tree. |
E |
getNode()
Get the node element object. |
int |
getNumChildren()
Get the number of children added to this node. |
Tree.Entry<E> |
getParent()
Get the entry for the parent node. |
boolean |
isFirstChild(E child)
Check if the specified object is the first child to this node. |
boolean |
isLastChild(E child)
Check if the specified object is the last child to this node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Tree<E> tree
private final E node
private final Tree.Entry<E> parent
private List<Tree.Entry<E>> children
private final int depth
Constructor Detail |
---|
private Tree.Entry(Tree<E> tree, E node, Tree.Entry<E> parent)
Method Detail |
---|
public E getNode()
public Tree.Entry<E> getParent()
Entry
object or null if this is the root entrypublic int getDepth()
public Tree.Entry<E> addChild(E child)
child
- The child to add
Entry
object of the new child node
IllegalArgumentException
- If the child already exists in the treepublic int getNumChildren()
public List<Tree.Entry<E>> getChildren()
List
containing the entries for the children
or null if no children has been added to this nodepublic boolean isFirstChild(E child)
child
- The object to check
public boolean isLastChild(E child)
child
- The object to check
private void addChildEntry(Tree.Entry<E> child)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |