Interface ITreeNode<V,T extends ITreeNode<V,T>>

Type Parameters:
V - the generic type of the value
T - the generic type of the concrete tree node
All Superinterfaces:
io.github.astrapi69.design.pattern.visitor.Acceptable<io.github.astrapi69.design.pattern.visitor.Visitor<T>>, io.github.astrapi69.tree.api.ITree<V,T>, Serializable
All Known Subinterfaces:
IBaseTreeNode<V,K,T>
All Known Implementing Classes:
BaseTreeNode, TreeNode

public interface ITreeNode<V,T extends ITreeNode<V,T>> extends io.github.astrapi69.tree.api.ITree<V,T>, io.github.astrapi69.design.pattern.visitor.Acceptable<io.github.astrapi69.design.pattern.visitor.Visitor<T>>
The Interface ITreeNode holds the children in a Collection object
  • Method Details

    • addChild

      default void addChild(T child)
      Specified by:
      addChild in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • addChild

      default void addChild(T child, int index)
      Specified by:
      addChild in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • getChildAt

      default Optional<T> getChildAt(int index)
      Specified by:
      getChildAt in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • getChildIndex

      default int getChildIndex(T child)
      Specified by:
      getChildIndex in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • addChildren

      default void addChildren(@NonNull @NonNull Collection<T> children)
      Specified by:
      addChildren in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • getAllSiblings

      default Collection<T> getAllSiblings()
      Specified by:
      getAllSiblings in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • getPreviousSibling

      default T getPreviousSibling()
      Specified by:
      getPreviousSibling in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • getNextSibling

      default T getNextSibling()
      Specified by:
      getNextSibling in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • getChildCount

      default int getChildCount()
      Specified by:
      getChildCount in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • getLevel

      default int getLevel()
      Specified by:
      getLevel in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • getRoot

      default T getRoot()
      Specified by:
      getRoot in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • hasChildren

      default boolean hasChildren()
      Specified by:
      hasChildren in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • hasNextSibling

      default boolean hasNextSibling()
      Specified by:
      hasNextSibling in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • hasParent

      default boolean hasParent()
      Specified by:
      hasParent in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • hasPreviousSibling

      default boolean hasPreviousSibling()
      Specified by:
      hasPreviousSibling in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • isNode

      default boolean isNode()
      Specified by:
      isNode in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • isRoot

      default boolean isRoot()
      Specified by:
      isRoot in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • removeChild

      default void removeChild(T child)
      Specified by:
      removeChild in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • isChild

      default boolean isChild(T child)
      Specified by:
      isChild in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • clearChildren

      default void clearChildren()
      Specified by:
      clearChildren in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • clearAll

      default void clearAll()
      Specified by:
      clearAll in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • removeChildren

      default void removeChildren()
      Specified by:
      removeChildren in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • removeChildren

      default void removeChildren(@NonNull @NonNull Collection<T> children)
      Specified by:
      removeChildren in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • accept

      default void accept(@NonNull @NonNull io.github.astrapi69.design.pattern.visitor.Visitor<T> visitor)
      Specified by:
      accept in interface io.github.astrapi69.design.pattern.visitor.Acceptable<V>
    • findAllByValue

      default Collection<T> findAllByValue(V value)
      Specified by:
      findAllByValue in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • findByValue

      default T findByValue(@NonNull V value)
      Specified by:
      findByValue in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • contains

      default boolean contains(T treeNode)
      Specified by:
      contains in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • containsAll

      default boolean containsAll(@NonNull @NonNull Collection<T> treeNodes)
      Specified by:
      containsAll in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • toList

      default List<T> toList()
      Specified by:
      toList in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • traverse

      default Collection<T> traverse()
      Specified by:
      traverse in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • isAncestor

      default boolean isAncestor(T treeNode)
      Specified by:
      isAncestor in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • isDescendant

      default boolean isDescendant(T treeNode)
      Specified by:
      isDescendant in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>
    • move

      default boolean move(T treeNode)
      Specified by:
      move in interface io.github.astrapi69.tree.api.ITree<V,T extends ITreeNode<V,T>>