Interface TreeNode<T>

  • Type Parameters:
    T - type of data associated with the node
    All Known Implementing Classes:
    DefaultTreeNode

    public interface TreeNode<T>
    A wrapper around a data object, for storing it in a tree structure.
    Author:
    Alison Walter
    • Method Detail

      • data

        T data()
        Gets the data associated with the node.
      • parent

        TreeNode<?> parent()
        Gets the parent of this node.
      • setParent

        void setParent​(TreeNode<?> parent)
      • children

        List<TreeNode<?>> children()
        Gets the node's children. If this list is mutated, the children will be affected accordingly. It is the responsibility of the caller to ensure continued integrity, particularly of parent linkages.
      • addChildren

        default void addChildren​(List<? extends TreeNode<?>> nodes)
        Adds the given list of children to this node.