Class OrderedSparseMultigraph<V,E>
java.lang.Object
edu.uci.ics.jung.graph.AbstractGraph<V,E>
edu.uci.ics.jung.graph.SparseMultigraph<V,E>
edu.uci.ics.jung.graph.OrderedSparseMultigraph<V,E>
- All Implemented Interfaces:
Graph<V,E>, Hypergraph<V, E>, MultiGraph<V, E>, Serializable
- Direct Known Subclasses:
SortedSparseMultigraph
An implementation of
Graph that orders its vertex and edge collections
according to insertion time, is suitable for sparse graphs, and
permits directed, undirected, and parallel edges.- See Also:
-
Field Summary
Fields inherited from class SparseMultigraph
directedEdges, edges, vertices -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAddsvertexto this graph.static <V,E> com.google.common.base.Supplier <Graph<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 tovertexvia any edges in this graph.getPredecessors(V vertex) Returns aCollectionview of the predecessors ofvertexin this graph.getSuccessors(V vertex) Returns aCollectionview of the successors ofvertexin this graph.Methods inherited from class SparseMultigraph
addEdge, containsEdge, containsVertex, findEdge, getDefaultEdgeType, getDest, getEdgeCount, getEdgeCount, getEdges, getEdges, getEdgeType, getEndpoints, getIncoming_internal, getInEdges, getOutEdges, getOutgoing_internal, getSource, getVertexCount, getVertices, isDest, isSource, removeEdge, removeVertexMethods inherited from class AbstractGraph
addEdge, addEdge, addEdge, addEdge, addEdge, degree, findEdgeSet, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toString
-
Constructor Details
-
OrderedSparseMultigraph
public OrderedSparseMultigraph()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
Supplierthat creates an instance of this graph type.
-
addVertex
Description copied from interface:HypergraphAddsvertexto this graph. Fails ifvertexis null or already in the graph.- Specified by:
addVertexin interfaceHypergraph<V,E> - Overrides:
addVertexin classSparseMultigraph<V,E> - Parameters:
vertex- the vertex to add- Returns:
trueif the add is successful, andfalseotherwise
-
getPredecessors
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 classSparseMultigraph<V,E> - Parameters:
vertex- the vertex whose predecessors are to be returned- Returns:
- a
Collectionview of the predecessors ofvertexin this graph
-
getSuccessors
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 classSparseMultigraph<V,E> - Parameters:
vertex- the vertex whose predecessors are to be returned- Returns:
- a
Collectionview of the successors ofvertexin this graph
-
getNeighbors
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 classSparseMultigraph<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
Description copied from interface:HypergraphReturns the collection of edges in this graph which are connected tovertex.- Specified by:
getIncidentEdgesin interfaceHypergraph<V,E> - Overrides:
getIncidentEdgesin classSparseMultigraph<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
-