Class Graphs.UnmodifiableTree<V,​E>

    • Constructor Detail

      • UnmodifiableTree

        private UnmodifiableTree​(Tree<V,​E> delegate)
    • Method Detail

      • getDepth

        public int getDepth​(V vertex)
        Description copied from interface: Tree
        Returns the (unweighted) distance of vertex from the root of this tree.
        Specified by:
        getDepth in interface Tree<V,​E>
        Parameters:
        vertex - the vertex whose depth is to be returned.
        Returns:
        the length of the shortest unweighted path from vertex to the root of this tree
        See Also:
        Tree.getHeight()
      • getHeight

        public int getHeight()
        Description copied from interface: Tree
        Returns the maximum depth in this tree.
        Specified by:
        getHeight in interface Tree<V,​E>
        Returns:
        the maximum depth in this tree
        See Also:
        Tree.getDepth(Object)
      • getRoot

        public V getRoot()
        Description copied from interface: Tree
        Returns the root of this tree. The root is defined to be the vertex (designated either at the tree's creation time, or as the first vertex to be added) with respect to which vertex depth is measured.
        Specified by:
        getRoot in interface Tree<V,​E>
        Returns:
        the root of this tree
      • getTrees

        public java.util.Collection<Tree<V,​E>> getTrees()
        Description copied from interface: Forest
        Returns a view of this graph as a collection of Tree instances.
        Specified by:
        getTrees in interface Forest<V,​E>
        Overrides:
        getTrees in class Graphs.UnmodifiableForest<V,​E>
        Returns:
        a view of this graph as a collection of Trees