T - the generic typepublic interface ITreeNode<T> extends Serializable
| Modifier and Type | Method and Description |
|---|---|
default void |
addChild(ITreeNode<T> child)
Adds the child.
|
default void |
addChildAt(int index,
ITreeNode<T> child)
Adds the child.
|
default List<ITreeNode<T>> |
getAllSiblings()
Returns all siblings of this node in the parent's children list.
|
default int |
getChildCount()
Gets the child count.
|
List<ITreeNode<T>> |
getChildren()
Gets the children.
|
default int |
getDepth()
Returns the depth of the tree beginning at this node Returns 0 if this node has no children.
|
String |
getDisplayValue()
Gets the optional display value.
|
default int |
getLevel()
Returns the distance from the root to this node.
|
default ITreeNode<T> |
getNextSibling()
Returns the next sibling of this node in the parent's children list.
|
ITreeNode<T> |
getParent()
Gets the parent.
|
default ITreeNode<T> |
getPreviousSibling()
Returns the previous sibling of this node in the parent's children list.
|
default ITreeNode<T> |
getRoot()
Gets the root
ITreeNode object |
T |
getValue()
Gets the value.
|
default boolean |
hasChildren()
Checks for children.
|
default boolean |
hasParent()
Checks for parent
|
default boolean |
isLeaf()
Checks if is leaf.
|
default boolean |
isNode()
Checks if is node.
|
default boolean |
isRoot()
|
default void |
removeChild(ITreeNode<T> child)
Removes the child.
|
default void |
removeChildAt(int index)
Removes the child.
|
void |
setChildren(List<ITreeNode<T>> children)
Sets the children.
|
void |
setDisplayValue(String displayValue)
Sets the optional display value.
|
void |
setParent(ITreeNode<T> parent)
Sets the parent.
|
void |
setValue(T value)
Sets the value.
|
default List<ITreeNode<T>> |
toList()
To list.
|
default void |
traverse(ITreeNode<T> node,
List<ITreeNode<T>> list)
Traverse.
|
default void addChildAt(int index,
ITreeNode<T> child)
throws IndexOutOfBoundsException
index - the indexchild - the childIndexOutOfBoundsException - the index out of bounds exceptiondefault List<ITreeNode<T>> getAllSiblings()
default int getChildCount()
default int getDepth()
String getDisplayValue()
default int getLevel()
default ITreeNode<T> getNextSibling()
default ITreeNode<T> getPreviousSibling()
default ITreeNode<T> getRoot()
ITreeNode objectITreeNode objectT getValue()
default boolean hasChildren()
default boolean hasParent()
default boolean isLeaf()
default boolean isNode()
default void removeChild(ITreeNode<T> child)
child - the childdefault void removeChildAt(int index)
throws IndexOutOfBoundsException
index - the indexIndexOutOfBoundsException - the index out of bounds exceptionvoid setChildren(List<ITreeNode<T>> children)
children - the new childrenvoid setDisplayValue(String displayValue)
displayValue - the new optional display valuevoid setValue(T value)
value - the new valueCopyright © 2015–2018 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.