Class UndirectedOrderedSparseMultigraph<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.UndirectedSparseMultigraph<V,E>
edu.uci.ics.jung.graph.UndirectedOrderedSparseMultigraph<V,E>
- All Implemented Interfaces:
Graph<V,E>, Hypergraph<V, E>, MultiGraph<V, E>, UndirectedGraph<V, E>, Serializable
public class UndirectedOrderedSparseMultigraph<V,E>
extends UndirectedSparseMultigraph<V,E>
implements UndirectedGraph<V,E>
An implementation of
UndirectedGraph that is suitable for sparse graphs,
orders its vertex and edge collections according to insertion time, and permits
parallel edges.- See Also:
-
Field Summary
Fields inherited from class UndirectedSparseMultigraph
edges, verticesFields inherited from class AbstractTypedGraph
edge_type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAddsvertexto this graph.static <V,E> com.google.common.base.Supplier <UndirectedGraph<V, E>> getNeighbors(V vertex) Returns the collection of vertices which are connected tovertexvia any edges in this graph.Methods inherited from class UndirectedSparseMultigraph
addEdge, addEdge, containsEdge, containsVertex, findEdge, getDest, getEdgeCount, getEdges, getEndpoints, getIncident_internal, getIncidentEdges, getInEdges, getOutEdges, getPredecessors, getSource, getSuccessors, getVertexCount, getVertices, isDest, isSource, removeEdge, removeVertexMethods inherited from class AbstractTypedGraph
getDefaultEdgeType, getEdgeCount, getEdges, getEdgeType, hasEqualEdgeType, validateEdgeTypeMethods inherited from class AbstractGraph
addEdge, addEdge, addEdge, addEdge, degree, findEdgeSet, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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, containsEdge, containsVertex, degree, findEdge, findEdgeSet, getDefaultEdgeType, getEdgeCount, getEdgeCount, getEdges, getEdges, getEdgeType, getIncidentCount, getIncidentEdges, getIncidentVertices, getNeighborCount, getVertexCount, getVertices, isIncident, isNeighbor, removeEdge, removeVertex
-
Constructor Details
-
UndirectedOrderedSparseMultigraph
public UndirectedOrderedSparseMultigraph()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 classUndirectedSparseMultigraph<V,E> - Parameters:
vertex- the vertex to add- Returns:
trueif the add is successful, andfalseotherwise
-
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 classUndirectedSparseMultigraph<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
-