Class TreeDirect<T>

java.lang.Object
org.aksw.commons.collections.trees.TreeDirect<T>
All Implemented Interfaces:
Tree<T>

public class TreeDirect<T> extends Object implements Tree<T>
  • Field Details

    • root

      protected T root
    • nodeToParent

      protected ReversibleMap<T,T> nodeToParent
  • Constructor Details

  • Method Details

    • getRoot

      public T getRoot()
      Specified by:
      getRoot in interface Tree<T>
    • getChildren

      public Collection<T> getChildren(T node)
      Specified by:
      getChildren in interface Tree<T>
    • getParent

      public T getParent(T node)
      Specified by:
      getParent in interface Tree<T>
    • copy

      public T copy(T node, List<T> children)
      Description copied from interface: Tree
      Copies a given node thereby setting the provided children as its children.
      Specified by:
      copy in interface Tree<T>
      Parameters:
      node -
      children -
      Returns:
      A copy of the given node with the children set appropriately
    • createNew

      public Tree<T> createNew(T root)
      Specified by:
      createNew in interface Tree<T>
    • nodeCount

      public long nodeCount()
      Specified by:
      nodeCount in interface Tree<T>