Module gen.tree

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>, java.io.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 Detail

      • addChild

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

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

        default java.util.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>>
      • 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 java.util.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 java.util.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 java.util.Collection<T> treeNodes)
        Specified by:
        containsAll in interface io.github.astrapi69.tree.api.ITree<V,​T extends ITreeNode<V,​T>>
      • toList

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

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