Package edu.uci.ics.jung.graph
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>
,java.io.Serializable
public class UndirectedOrderedSparseMultigraph<V,E> extends UndirectedSparseMultigraph<V,E> implements UndirectedGraph<V,E>
An implementation ofUndirectedGraph
that is suitable for sparse graphs, orders its vertex and edge collections according to insertion time, and permits parallel edges.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class edu.uci.ics.jung.graph.UndirectedSparseMultigraph
edges, vertices
-
Fields inherited from class edu.uci.ics.jung.graph.AbstractTypedGraph
edge_type
-
-
Constructor Summary
Constructors Constructor Description UndirectedOrderedSparseMultigraph()
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addVertex(V vertex)
Addsvertex
to this graph.static <V,E>
com.google.common.base.Supplier<UndirectedGraph<V,E>>getFactory()
java.util.Collection<V>
getNeighbors(V vertex)
Returns the collection of vertices which are connected tovertex
via any edges in this graph.-
Methods inherited from class edu.uci.ics.jung.graph.UndirectedSparseMultigraph
addEdge, addEdge, containsEdge, containsVertex, findEdge, getDest, getEdgeCount, getEdges, getEndpoints, getIncident_internal, getIncidentEdges, getInEdges, getOutEdges, getPredecessors, getSource, getSuccessors, 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, 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, getPredecessors, getSource, getSuccessorCount, getSuccessors, 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, getIncidentEdges, getIncidentVertices, getNeighborCount, getVertexCount, getVertices, isIncident, isNeighbor, removeEdge, removeVertex
-
-
-
-
Method Detail
-
getFactory
public static <V,E> com.google.common.base.Supplier<UndirectedGraph<V,E>> 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
public boolean addVertex(V vertex)
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 classUndirectedSparseMultigraph<V,E>
- Parameters:
vertex
- the vertex to add- Returns:
true
if the add is successful, andfalse
otherwise
-
getNeighbors
public java.util.Collection<V> getNeighbors(V vertex)
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 classUndirectedSparseMultigraph<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
-
-