Package edu.uci.ics.jung.graph.util
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>,java.io.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 edu.uci.ics.jung.graph.util.Graphs.SynchronizedAbstractGraph
delegate
-
-
Constructor Summary
Constructors Constructor Description SynchronizedForest(Forest<V,E> delegate)Creates a new instance based on the provideddelegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetChildCount(V vertex)Returns the number of children thatvertexhas in this tree.java.util.Collection<E>getChildEdges(V vertex)Returns the edges connectingvertexto its children in this tree.java.util.Collection<V>getChildren(V vertex)Returns the children ofvertexin this tree.VgetParent(V vertex)Returns the parent ofvertexin this tree.EgetParentEdge(V vertex)Returns the edge connectingvertexto its parent in this tree.java.util.Collection<Tree<V,E>>getTrees()Returns a view of this graph as a collection ofTreeinstances.-
Methods inherited from class edu.uci.ics.jung.graph.util.Graphs.SynchronizedDirectedGraph
getDest, getSource, isDest, isSource
-
Methods inherited from class edu.uci.ics.jung.graph.util.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, removeVertex
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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, outDegree
-
Methods 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 Detail
-
getTrees
public java.util.Collection<Tree<V,E>> getTrees()
Description copied from interface:ForestReturns a view of this graph as a collection ofTreeinstances.
-
getChildCount
public int getChildCount(V vertex)
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:
Forest.getChildEdges(Object),Forest.getChildren(Object),Graph.getSuccessorCount(Object)
-
getChildEdges
public java.util.Collection<E> getChildEdges(V vertex)
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:
Graph.getOutEdges(Object),Forest.getChildren(Object)
-
getChildren
public java.util.Collection<V> getChildren(V vertex)
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:
Graph.getSuccessors(Object),Forest.getChildEdges(Object)
-
getParent
public V getParent(V vertex)
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().- Specified by:
getParentin interfaceForest<V,E>- Parameters:
vertex- the vertex whose parent is to be returned- Returns:
- the parent of
vertexin this tree - See Also:
Graph.getPredecessors(Object),Forest.getParentEdge(Object)
-
getParentEdge
public E getParentEdge(V vertex)
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:
Graph.getInEdges(Object),Forest.getParent(Object)
-
-