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> Serializable
public class DirectedOrderedSparseMultigraph<V,E>
extends DirectedSparseMultigraph<V,E>
implements DirectedGraph<V,E>, MultiGraph<V,E>
An implementation of
DirectedGraph
, suitable for sparse graphs,
that orders its vertex and edge collections
according to insertion time.- See Also:
-
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 -
Method Summary
Modifier and TypeMethodDescriptionboolean
Addsvertex
to this graph.static <V,
E> com.google.common.base.Supplier <DirectedGraph<V, E>> getIncidentEdges
(V vertex) Returns the collection of edges in this graph which are connected tovertex
.getNeighbors
(V vertex) Returns the collection of vertices which are connected tovertex
via any edges in this graph.getPredecessors
(V vertex) Returns aCollection
view of the predecessors ofvertex
in this graph.getSuccessors
(V vertex) Returns aCollection
view of the successors ofvertex
in 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
-
Constructor Details
-
DirectedOrderedSparseMultigraph
public DirectedOrderedSparseMultigraph()Creates a new instance.
-
-
Method Details
-
getFactory
- Type Parameters:
V
- the vertex type for the graph SupplierE
- the edge type for the graph Supplier- Returns:
- a
Supplier
that creates an instance of this graph type.
-
addVertex
Description copied from interface:Hypergraph
Addsvertex
to this graph. Fails ifvertex
is null or already in the graph.- Specified by:
addVertex
in interfaceHypergraph<V,
E> - Overrides:
addVertex
in classDirectedSparseMultigraph<V,
E> - Parameters:
vertex
- the vertex to add- Returns:
true
if the add is successful, andfalse
otherwise
-
getPredecessors
Description copied from interface:Graph
Returns aCollection
view of the predecessors ofvertex
in this graph. A predecessor ofvertex
is defined as a vertexv
which is connected tovertex
by an edgee
, wheree
is an outgoing edge ofv
and an incoming edge ofvertex
.- Specified by:
getPredecessors
in interfaceGraph<V,
E> - Specified by:
getPredecessors
in interfaceHypergraph<V,
E> - Overrides:
getPredecessors
in classDirectedSparseMultigraph<V,
E> - Parameters:
vertex
- the vertex whose predecessors are to be returned- Returns:
- a
Collection
view of the predecessors ofvertex
in this graph
-
getSuccessors
Description copied from interface:Graph
Returns aCollection
view of the successors ofvertex
in this graph. A successor ofvertex
is defined as a vertexv
which is connected tovertex
by an edgee
, wheree
is an incoming edge ofv
and an outgoing edge ofvertex
.- Specified by:
getSuccessors
in interfaceGraph<V,
E> - Specified by:
getSuccessors
in interfaceHypergraph<V,
E> - Overrides:
getSuccessors
in classDirectedSparseMultigraph<V,
E> - Parameters:
vertex
- the vertex whose predecessors are to be returned- Returns:
- a
Collection
view of the successors ofvertex
in this graph
-
getNeighbors
Description copied from interface:Hypergraph
Returns the collection of vertices which are connected tovertex
via any edges in this graph. Ifvertex
is connected to itself with a self-loop, then it will be included in the collection returned.- Specified by:
getNeighbors
in interfaceHypergraph<V,
E> - Overrides:
getNeighbors
in classDirectedSparseMultigraph<V,
E> - Parameters:
vertex
- the vertex whose neighbors are to be returned- Returns:
- the collection of vertices which are connected to
vertex
, ornull
ifvertex
is not present
-
getIncidentEdges
Description copied from interface:Hypergraph
Returns the collection of edges in this graph which are connected tovertex
.- Specified by:
getIncidentEdges
in interfaceHypergraph<V,
E> - Overrides:
getIncidentEdges
in classDirectedSparseMultigraph<V,
E> - Parameters:
vertex
- the vertex whose incident edges are to be returned- Returns:
- the collection of edges which are connected to
vertex
, ornull
ifvertex
is not present
-