- java.lang.Object
-
- io.github.astrapi69.gen.tree.BaseTreeNode<T,K>
-
- Type Parameters:
T
- the generic type of the valueK
- the generic type of the id of 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<T,K>>>
,IBaseTreeNode<T,K,BaseTreeNode<T,K>>
,ITreeNode<T,BaseTreeNode<T,K>>
,io.github.astrapi69.tree.api.ITree<T,BaseTreeNode<T,K>>
,java.io.Serializable
public class BaseTreeNode<T,K> extends java.lang.Object implements IBaseTreeNode<T,K,BaseTreeNode<T,K>>
The generic classBaseTreeNode
have a generic id and value object- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BaseTreeNode(T value)
Instantiates a newBaseTreeNode
object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<BaseTreeNode<T,K>>
getChildren()
Gets the children of this nodevoid
sortChildren()
Sorts the children collection if the comparator is not null-
Methods 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, addChildren, clearAll, clearChildren, contains, containsAll, findAllByValue, findByValue, getAllSiblings, getChildCount, getLevel, getNextSibling, getPreviousSibling, getRoot, hasChildren, hasNextSibling, hasParent, hasPreviousSibling, isNode, isRoot, removeChild, removeChildren, removeChildren, toList, traverse
-
-
-
-
Constructor Detail
-
BaseTreeNode
public BaseTreeNode(T value)
Instantiates a newBaseTreeNode
object- Parameters:
value
- the value
-
-
Method Detail
-
getChildren
public java.util.Collection<BaseTreeNode<T,K>> 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<T,K,BaseTreeNode<T,K>>
-
-