Class Graphs.SynchronizedForest<V,E>
java.lang.Object
edu.uci.ics.jung.graph.util.Graphs.SynchronizedAbstractGraph<V,E>
edu.uci.ics.jung.graph.util.Graphs.SynchronizedDirectedGraph<V,E>
edu.uci.ics.jung.graph.util.Graphs.SynchronizedForest<V,E>
- All Implemented Interfaces:
DirectedGraph<V,E>, Forest<V, E>, Graph<V, E>, Hypergraph<V, E>, Serializable
- Direct Known Subclasses:
Graphs.SynchronizedTree
- Enclosing class:
Graphs
static class Graphs.SynchronizedForest<V,E>
extends Graphs.SynchronizedDirectedGraph<V,E>
implements Forest<V,E>
-
Field Summary
Fields inherited from class Graphs.SynchronizedAbstractGraph
delegate -
Constructor Summary
ConstructorsConstructorDescriptionSynchronizedForest(Forest<V, E> delegate) Creates a new instance based on the provideddelegate. -
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 class Graphs.SynchronizedDirectedGraph
getDest, getSource, isDest, isSourceMethods inherited from class Graphs.SynchronizedAbstractGraph
addEdge, addEdge, addEdge, addEdge, addVertex, containsEdge, containsVertex, degree, findEdge, findEdgeSet, getDefaultEdgeType, getEdgeCount, getEdgeCount, getEdges, getEdges, getEdgeType, getEndpoints, getIncidentCount, getIncidentEdges, getIncidentVertices, getInEdges, getNeighborCount, getNeighbors, getOpposite, getOutEdges, getPredecessorCount, getPredecessors, getSuccessorCount, getSuccessors, getVertexCount, getVertices, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, removeEdge, removeVertexMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Graph
addEdge, addEdge, getDest, getEndpoints, getInEdges, getOpposite, getOutEdges, getPredecessorCount, getPredecessors, getSource, getSuccessorCount, getSuccessors, inDegree, isDest, isPredecessor, isSource, isSuccessor, outDegreeMethods inherited from interface 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
-
Constructor Details
-
SynchronizedForest
-
-
Method Details
-
getTrees
-
getChildCount
Description copied from interface:ForestReturns 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).- Specified by:
getChildCountin interfaceForest<V,E> - Parameters:
vertex- the vertex whose child edges are to be returned- Returns:
- the
Collectionof edges connectingvertexto its children in this tree - See Also:
-
getChildEdges
Description copied from interface:ForestReturns 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).- Specified by:
getChildEdgesin interfaceForest<V,E> - Parameters:
vertex- the vertex whose child edges are to be returned- Returns:
- the
Collectionof edges connectingvertexto its children in this tree - See Also:
-
getChildren
Description copied from interface:ForestReturns 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).- Specified by:
getChildrenin interfaceForest<V,E> - Parameters:
vertex- the vertex whose children are to be returned- Returns:
- the
Collectionof children ofvertexin this tree - See Also:
-
getParent
Description copied from interface:ForestReturns 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(). -
getParentEdge
Description copied from interface:ForestReturns 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)).- Specified by:
getParentEdgein interfaceForest<V,E> - Parameters:
vertex- the vertex whose incoming edge is to be returned- Returns:
- the edge connecting
vertexto its parent, ornullifvertexis the root - See Also:
-