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>, Serializable
public class UndirectedOrderedSparseMultigraph<V,E>
- extends UndirectedSparseMultigraph<V,E>
- implements UndirectedGraph<V,E>, Serializable
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:
- Serialized Form
Method Summary |
boolean |
addVertex(V vertex)
Adds vertex to this graph. |
static
|
getFactory()
Returns a Factory that creates an instance of this graph type. |
Collection<V> |
getNeighbors(V vertex)
Returns the collection of vertices which are connected to vertex
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.AbstractGraph |
addEdge, addEdge, addEdge, addEdge, degree, findEdgeSet, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toString |
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 |
UndirectedOrderedSparseMultigraph
public UndirectedOrderedSparseMultigraph()
- Creates a new instance.
getFactory
public static <V,E> org.apache.commons.collections15.Factory<UndirectedGraph<V,E>> getFactory()
- Returns a
Factory
that creates an instance of this graph type.
- Type Parameters:
V
- the vertex type for the graph factoryE
- the edge type for the graph factory
addVertex
public boolean addVertex(V vertex)
- Description copied from interface:
Hypergraph
- Adds
vertex
to this graph.
Fails if vertex
is null or already in the graph.
- Specified by:
addVertex
in interface Hypergraph<V,E>
- Overrides:
addVertex
in class UndirectedSparseMultigraph<V,E>
- Parameters:
vertex
- the vertex to add
- Returns:
true
if the add is successful, and false
otherwise
getNeighbors
public Collection<V> getNeighbors(V vertex)
- Description copied from interface:
Hypergraph
- Returns the collection of vertices which are connected to
vertex
via any edges in this graph.
If vertex
is connected to itself with a self-loop, then
it will be included in the collection returned.
- Specified by:
getNeighbors
in interface Hypergraph<V,E>
- Overrides:
getNeighbors
in class UndirectedSparseMultigraph<V,E>
- Parameters:
vertex
- the vertex whose neighbors are to be returned
- Returns:
- the collection of vertices which are connected to
vertex
,
or null
if vertex
is not present
Copyright © 2009. All Rights Reserved.