Package edu.uci.ics.jung.graph
Interface Forest<V,E>
- All Superinterfaces:
DirectedGraph<V,,E> Graph<V,,E> Hypergraph<V,E>
- All Known Subinterfaces:
Tree<V,E>
- All Known Implementing Classes:
DelegateForest,DelegateTree,OrderedKAryTree
An interface for a graph which consists of a collection of rooted
directed acyclic graphs.
- Author:
- Joshua O'Madadhain
-
Method Summary
Modifier and TypeMethodDescriptionintgetChildCount(V vertex) Returns the number of children thatvertexhas in this tree.getChildEdges(V vertex) Returns the edges connectingvertexto its children in this tree.getChildren(V vertex) Returns the children ofvertexin this tree.Returns the parent ofvertexin this tree.getParentEdge(V vertex) Returns the edge connectingvertexto its parent in this tree.Collection<Tree<V, E>> getTrees()Returns a view of this graph as a collection ofTreeinstances.Methods inherited from interface edu.uci.ics.jung.graph.Graph
addEdge, addEdge, getDest, getEndpoints, getInEdges, getOpposite, getOutEdges, getPredecessorCount, getPredecessors, getSource, getSuccessorCount, getSuccessors, inDegree, isDest, isPredecessor, isSource, isSuccessor, outDegreeMethods inherited from interface edu.uci.ics.jung.graph.Hypergraph
addEdge, addEdge, addVertex, containsEdge, containsVertex, degree, findEdge, findEdgeSet, getDefaultEdgeType, getEdgeCount, getEdgeCount, getEdges, getEdges, getEdgeType, getIncidentCount, getIncidentEdges, getIncidentVertices, getNeighborCount, getNeighbors, getVertexCount, getVertices, isIncident, isNeighbor, removeEdge, removeVertex
-
Method Details
-
getTrees
Collection<Tree<V,E>> getTrees()Returns a view of this graph as a collection ofTreeinstances.- Returns:
- a view of this graph as a collection of
Trees
-
getParent
Returns the parent ofvertexin this tree. (Ifvertexis the root, returnsnull.) 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 toGraph.getPredecessors(vertex).iterator().next().- Parameters:
vertex- the vertex whose parent is to be returned- Returns:
- the parent of
vertexin this tree - See Also:
-
getParentEdge
Returns the edge connectingvertexto its parent in this tree. (Ifvertexis the root, returnsnull.) 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 toGraph.getInEdges(vertex).iterator().next(), and also toGraph.findEdge(vertex, getParent(vertex)).- Parameters:
vertex- the vertex whose incoming edge is to be returned- Returns:
- the edge connecting
vertexto its parent, ornullifvertexis the root - See Also:
-
getChildren
Returns the children ofvertexin 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 forgetSuccessors(vertex).- Parameters:
vertex- the vertex whose children are to be returned- Returns:
- the
Collectionof children ofvertexin this tree - See Also:
-
getChildEdges
Returns the edges connectingvertexto 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 forgetOutEdges(vertex).- Parameters:
vertex- the vertex whose child edges are to be returned- Returns:
- the
Collectionof edges connectingvertexto its children in this tree - See Also:
-
getChildCount
Returns the number of children thatvertexhas 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 forgetSuccessorCount(vertex).- Parameters:
vertex- the vertex whose child edges are to be returned- Returns:
- the
Collectionof edges connectingvertexto its children in this tree - See Also:
-