Interface IChainableTreeNode<T>

  • Type Parameters:
    T - the generic type of the value
    All Known Implementing Classes:
    ChainableTreeNode

    public interface IChainableTreeNode<T>
    The interface IChainableTreeNode represents a chainable tree node
    • Method Detail

      • getChildCount

        default int getChildCount()
        Gets the child count.
        Returns:
        the child count
      • getChildren

        default java.util.List<IChainableTreeNode<T>> getChildren()
        Gets the children from the current tree node
        Returns:
        the children from the current tree node
      • getLevel

        default int getLevel()
        Returns the distance from the root to this node. Returns 0 if this node is the root.
        Returns:
        the level from this node.
      • getValue

        T getValue()
        Gets the value.
        Returns:
        the value
      • hasChild

        default boolean hasChild()
        Checks if this tree node has a child
        Returns:
        true, if successful
      • hasParent

        default boolean hasParent()
        Checks for parent
        Returns:
        true, if successful
      • isRoot

        default boolean isRoot()
        Checks if this treenode is root.
        Returns:
        true, if is root
      • setChild

        void setChild​(IChainableTreeNode<T> child)
        Sets the child.
        Parameters:
        child - the new child
      • setParent

        void setParent​(IChainableTreeNode<T> parent)
        Sets the parent.
        Parameters:
        parent - the new parent
      • setValue

        void setValue​(T value)
        Sets the value.
        Parameters:
        value - the new value
      • toList

        default java.util.List<IChainableTreeNode<T>> toList()
        Transforms this tree node object to an ordered LinkedList with all tree nodes
        Returns:
        the ordered LinkedList with all tree nodes