Class Graphs.UnmodifiableForest<V,​E>

    • Constructor Detail

      • UnmodifiableForest

        private UnmodifiableForest​(Forest<V,​E> delegate)
    • Method Detail

      • 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>
        Returns:
        a view of this graph as a collection of Trees
      • getChildCount

        public int getChildCount​(V vertex)
        Description copied from interface: Forest
        Returns the number of children that vertex has in this tree. The children of a vertex are defined as being the successors of that vertex on the respective (unique) shortest paths from the root to those vertices. This is syntactic (maple) sugar for getSuccessorCount(vertex).
        Specified by:
        getChildCount in interface Forest<V,​E>
        Parameters:
        vertex - the vertex whose child edges are to be returned
        Returns:
        the Collection of edges connecting vertex to its children in this tree
        See Also:
        Forest.getChildEdges(Object), Forest.getChildren(Object), Graph.getSuccessorCount(Object)
      • getChildEdges

        public java.util.Collection<E> getChildEdges​(V vertex)
        Description copied from interface: Forest
        Returns the edges connecting vertex to its children in this tree. The children of a vertex are defined as being the successors of that vertex on the respective (unique) shortest paths from the root to those vertices. This is syntactic (maple) sugar for getOutEdges(vertex).
        Specified by:
        getChildEdges in interface Forest<V,​E>
        Parameters:
        vertex - the vertex whose child edges are to be returned
        Returns:
        the Collection of edges connecting vertex to its children in this tree
        See Also:
        Graph.getOutEdges(Object), Forest.getChildren(Object)
      • getChildren

        public java.util.Collection<V> getChildren​(V vertex)
        Description copied from interface: Forest
        Returns the children of vertex in this tree. The children of a vertex are defined as being the successors of that vertex on the respective (unique) shortest paths from the root to those vertices. This is syntactic (maple) sugar for getSuccessors(vertex).
        Specified by:
        getChildren in interface Forest<V,​E>
        Parameters:
        vertex - the vertex whose children are to be returned
        Returns:
        the Collection of children of vertex in this tree
        See Also:
        Graph.getSuccessors(Object), Forest.getChildEdges(Object)
      • getParent

        public V getParent​(V vertex)
        Description copied from interface: Forest
        Returns the parent of vertex in this tree. (If vertex is the root, returns null.) The parent of a vertex is defined as being its predecessor in the (unique) shortest path from the root to this vertex. This is a convenience method which is equivalent to Graph.getPredecessors(vertex).iterator().next().
        Specified by:
        getParent in interface Forest<V,​E>
        Parameters:
        vertex - the vertex whose parent is to be returned
        Returns:
        the parent of vertex in this tree
        See Also:
        Graph.getPredecessors(Object), Forest.getParentEdge(Object)
      • getParentEdge

        public E getParentEdge​(V vertex)
        Description copied from interface: Forest
        Returns the edge connecting vertex to its parent in this tree. (If vertex is the root, returns null.) The parent of a vertex is defined as being its predecessor in the (unique) shortest path from the root to this vertex. This is a convenience method which is equivalent to Graph.getInEdges(vertex).iterator().next(), and also to Graph.findEdge(vertex, getParent(vertex)).
        Specified by:
        getParentEdge in interface Forest<V,​E>
        Parameters:
        vertex - the vertex whose incoming edge is to be returned
        Returns:
        the edge connecting vertex to its parent, or null if vertex is the root
        See Also:
        Graph.getInEdges(Object), Forest.getParent(Object)