Package io.github.astrapi69.gen.tree
Class BaseTreeNode<V,K>
java.lang.Object
io.github.astrapi69.gen.tree.BaseTreeNode<V,K>
- Type Parameters:
V
- the generic type of the valueK
- the generic type of the id from the node
- All Implemented Interfaces:
io.github.astrapi69.data.identifiable.GenericIdentifiable<K>
,io.github.astrapi69.design.pattern.visitor.Acceptable<io.github.astrapi69.design.pattern.visitor.Visitor<BaseTreeNode<V,
,K>>> IBaseTreeNode<V,
,K, BaseTreeNode<V, K>> ITreeNode<V,
,BaseTreeNode<V, K>> io.github.astrapi69.tree.api.ITree<V,
,BaseTreeNode<V, K>> Serializable
The generic class
BaseTreeNode
have a generic id and value object- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the children of this nodevoid
Sorts the children collection if the comparator is not nullMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.astrapi69.data.identifiable.GenericIdentifiable
getId, setId
Methods inherited from interface io.github.astrapi69.gen.tree.api.IBaseTreeNode
findById
Methods inherited from interface io.github.astrapi69.tree.api.ITree
getDisplayValue, getParent, getValue, isLeaf, setChildren, setDisplayValue, setLeaf, setParent, setValue
Methods inherited from interface io.github.astrapi69.gen.tree.api.ITreeNode
accept, addChild, addChild, addChildren, clearAll, clearChildren, contains, containsAll, findAllByValue, findByValue, getAllSiblings, getChildAt, getChildCount, getChildIndex, getLevel, getNextSibling, getPreviousSibling, getRoot, hasChildren, hasNextSibling, hasParent, hasPreviousSibling, isAncestor, isChild, isDescendant, isNode, isRoot, move, removeChild, removeChildren, removeChildren, toList, traverse
-
Constructor Details
-
BaseTreeNode
Instantiates a newBaseTreeNode
object- Parameters:
value
- the value
-
-
Method Details
-
getChildren
Gets the children of this node -
sortChildren
public void sortChildren()Sorts the children collection if the comparator is not null- Specified by:
sortChildren
in interfaceIBaseTreeNode<V,
K, BaseTreeNode<V, K>>
-