public interface Forest<V,E> extends DirectedGraph<V,E>
| Modifier and Type | Method and Description |
|---|---|
int |
getChildCount(V vertex)
Returns the number of children that
vertex has in this tree. |
Collection<E> |
getChildEdges(V vertex)
Returns the edges connecting
vertex to its children
in this tree. |
Collection<V> |
getChildren(V vertex)
Returns the children of
vertex in this tree. |
V |
getParent(V vertex)
Returns the parent of
vertex in this tree. |
E |
getParentEdge(V vertex)
Returns the edge connecting
vertex to its parent in
this tree. |
Collection<Tree<V,E>> |
getTrees()
Returns a view of this graph as a collection of
Tree instances. |
addEdge, addEdge, getDest, getEndpoints, getInEdges, getOpposite, getOutEdges, getPredecessorCount, getPredecessors, getSource, getSuccessorCount, getSuccessors, inDegree, isDest, isPredecessor, isSource, isSuccessor, outDegreeaddEdge, addEdge, addVertex, containsEdge, containsVertex, degree, findEdge, findEdgeSet, getDefaultEdgeType, getEdgeCount, getEdgeCount, getEdges, getEdges, getEdgeType, getIncidentCount, getIncidentEdges, getIncidentVertices, getNeighborCount, getNeighbors, getVertexCount, getVertices, isIncident, isNeighbor, removeEdge, removeVertexCollection<Tree<V,E>> getTrees()
Tree instances.TreesV getParent(V vertex)
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().vertex - the vertex whose parent is to be returnedvertex in this treeGraph.getPredecessors(Object),
getParentEdge(Object)E getParentEdge(V vertex)
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)).vertex - the vertex whose incoming edge is to be returnedvertex to its parent, or
null if vertex is the rootGraph.getInEdges(Object),
getParent(Object)Collection<V> getChildren(V vertex)
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).vertex - the vertex whose children are to be returnedCollection of children of vertex
in this treeGraph.getSuccessors(Object),
getChildEdges(Object)Collection<E> getChildEdges(V vertex)
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).vertex - the vertex whose child edges are to be returnedCollection of edges connecting
vertex to its children in this treeGraph.getOutEdges(Object),
getChildren(Object)int getChildCount(V vertex)
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).vertex - the vertex whose child edges are to be returnedCollection of edges connecting
vertex to its children in this treegetChildEdges(Object),
getChildren(Object),
Graph.getSuccessorCount(Object)Copyright © 2016. All rights reserved.