Package edu.uci.ics.jung.graph
Class DirectedOrderedSparseMultigraph<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.graph.AbstractGraph<V,E>
-
- edu.uci.ics.jung.graph.AbstractTypedGraph<V,E>
-
- edu.uci.ics.jung.graph.DirectedSparseMultigraph<V,E>
-
- edu.uci.ics.jung.graph.DirectedOrderedSparseMultigraph<V,E>
-
- All Implemented Interfaces:
DirectedGraph<V,E>,Graph<V,E>,Hypergraph<V,E>,MultiGraph<V,E>,java.io.Serializable
public class DirectedOrderedSparseMultigraph<V,E> extends DirectedSparseMultigraph<V,E> implements DirectedGraph<V,E>, MultiGraph<V,E>
An implementation ofDirectedGraph, suitable for sparse graphs, that orders its vertex and edge collections according to insertion time.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class edu.uci.ics.jung.graph.DirectedSparseMultigraph
edges, vertices
-
Fields inherited from class edu.uci.ics.jung.graph.AbstractTypedGraph
edge_type
-
-
Constructor Summary
Constructors Constructor Description DirectedOrderedSparseMultigraph()Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddVertex(V vertex)Addsvertexto this graph.static <V,E>
com.google.common.base.Supplier<DirectedGraph<V,E>>getFactory()java.util.Collection<E>getIncidentEdges(V vertex)Returns the collection of edges in this graph which are connected tovertex.java.util.Collection<V>getNeighbors(V vertex)Returns the collection of vertices which are connected tovertexvia any edges in this graph.java.util.Collection<V>getPredecessors(V vertex)Returns aCollectionview of the predecessors ofvertexin this graph.java.util.Collection<V>getSuccessors(V vertex)Returns aCollectionview of the successors ofvertexin this graph.-
Methods inherited from class edu.uci.ics.jung.graph.DirectedSparseMultigraph
addEdge, containsEdge, containsVertex, findEdge, getDest, getEdgeCount, getEdges, getEndpoints, getIncoming_internal, getInEdges, getOutEdges, getOutgoing_internal, getSource, getVertexCount, getVertices, isDest, isSource, removeEdge, removeVertex
-
Methods inherited from class edu.uci.ics.jung.graph.AbstractTypedGraph
getDefaultEdgeType, getEdgeCount, getEdges, getEdgeType, hasEqualEdgeType, validateEdgeType
-
Methods inherited from class edu.uci.ics.jung.graph.AbstractGraph
addEdge, addEdge, addEdge, addEdge, addEdge, degree, findEdgeSet, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.uci.ics.jung.graph.Graph
addEdge, addEdge, getDest, getEndpoints, getInEdges, getOpposite, getOutEdges, getPredecessorCount, getSource, getSuccessorCount, inDegree, isDest, isPredecessor, isSource, isSuccessor, outDegree
-
Methods inherited from interface edu.uci.ics.jung.graph.Hypergraph
addEdge, addEdge, containsEdge, containsVertex, degree, findEdge, findEdgeSet, getDefaultEdgeType, getEdgeCount, getEdgeCount, getEdges, getEdges, getEdgeType, getIncidentCount, getIncidentVertices, getNeighborCount, getVertexCount, getVertices, isIncident, isNeighbor, removeEdge, removeVertex
-
-
-
-
Method Detail
-
getFactory
public static <V,E> com.google.common.base.Supplier<DirectedGraph<V,E>> getFactory()
- Type Parameters:
V- the vertex type for the graph SupplierE- the edge type for the graph Supplier- Returns:
- a
Supplierthat creates an instance of this graph type.
-
addVertex
public boolean addVertex(V vertex)
Description copied from interface:HypergraphAddsvertexto this graph. Fails ifvertexis null or already in the graph.- Specified by:
addVertexin interfaceHypergraph<V,E>- Overrides:
addVertexin classDirectedSparseMultigraph<V,E>- Parameters:
vertex- the vertex to add- Returns:
trueif the add is successful, andfalseotherwise
-
getPredecessors
public java.util.Collection<V> getPredecessors(V vertex)
Description copied from interface:GraphReturns aCollectionview of the predecessors ofvertexin this graph. A predecessor ofvertexis defined as a vertexvwhich is connected tovertexby an edgee, whereeis an outgoing edge ofvand an incoming edge ofvertex.- Specified by:
getPredecessorsin interfaceGraph<V,E>- Specified by:
getPredecessorsin interfaceHypergraph<V,E>- Overrides:
getPredecessorsin classDirectedSparseMultigraph<V,E>- Parameters:
vertex- the vertex whose predecessors are to be returned- Returns:
- a
Collectionview of the predecessors ofvertexin this graph
-
getSuccessors
public java.util.Collection<V> getSuccessors(V vertex)
Description copied from interface:GraphReturns aCollectionview of the successors ofvertexin this graph. A successor ofvertexis defined as a vertexvwhich is connected tovertexby an edgee, whereeis an incoming edge ofvand an outgoing edge ofvertex.- Specified by:
getSuccessorsin interfaceGraph<V,E>- Specified by:
getSuccessorsin interfaceHypergraph<V,E>- Overrides:
getSuccessorsin classDirectedSparseMultigraph<V,E>- Parameters:
vertex- the vertex whose predecessors are to be returned- Returns:
- a
Collectionview of the successors ofvertexin this graph
-
getNeighbors
public java.util.Collection<V> getNeighbors(V vertex)
Description copied from interface:HypergraphReturns the collection of vertices which are connected tovertexvia any edges in this graph. Ifvertexis connected to itself with a self-loop, then it will be included in the collection returned.- Specified by:
getNeighborsin interfaceHypergraph<V,E>- Overrides:
getNeighborsin classDirectedSparseMultigraph<V,E>- Parameters:
vertex- the vertex whose neighbors are to be returned- Returns:
- the collection of vertices which are connected to
vertex, ornullifvertexis not present
-
getIncidentEdges
public java.util.Collection<E> getIncidentEdges(V vertex)
Description copied from interface:HypergraphReturns the collection of edges in this graph which are connected tovertex.- Specified by:
getIncidentEdgesin interfaceHypergraph<V,E>- Overrides:
getIncidentEdgesin classDirectedSparseMultigraph<V,E>- Parameters:
vertex- the vertex whose incident edges are to be returned- Returns:
- the collection of edges which are connected to
vertex, ornullifvertexis not present
-
-