Class BaseTreeNode<V,K>

java.lang.Object
io.github.astrapi69.gen.tree.BaseTreeNode<V,K>
Type Parameters:
V - the generic type of the value
K - 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

public class BaseTreeNode<V,K> extends Object implements IBaseTreeNode<V,K,BaseTreeNode<V,K>>
The generic class BaseTreeNode have a generic id and value object
See Also:
  • Constructor Details

    • BaseTreeNode

      public BaseTreeNode(V value)
      Instantiates a new BaseTreeNode object
      Parameters:
      value - the value
  • Method Details

    • getChildren

      public Collection<BaseTreeNode<V,K>> getChildren()
      Gets the children of this node
      Specified by:
      getChildren in interface io.github.astrapi69.tree.api.ITree<V,K>
      Returns:
      the children
    • sortChildren

      public void sortChildren()
      Sorts the children collection if the comparator is not null
      Specified by:
      sortChildren in interface IBaseTreeNode<V,K,BaseTreeNode<V,K>>