Package edu.uci.ics.jung.graph
Class UndirectedSparseGraph<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.UndirectedSparseGraph<V,E>
-
- All Implemented Interfaces:
edu.uci.ics.jung.graph.Graph<V,E>
,edu.uci.ics.jung.graph.Hypergraph<V,E>
,edu.uci.ics.jung.graph.UndirectedGraph<V,E>
,java.io.Serializable
public class UndirectedSparseGraph<V,E> extends AbstractTypedGraph<V,E> implements edu.uci.ics.jung.graph.UndirectedGraph<V,E>
An implementation ofUndirectedGraph
that is suitable for sparse graphs.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UndirectedSparseGraph()
Creates an instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addEdge(E edge, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints, edu.uci.ics.jung.graph.util.EdgeType edgeType)
Addsedge
to this graph with the specifiedendpoints
andEdgeType
.boolean
addVertex(V vertex)
boolean
containsEdge(E edge)
boolean
containsVertex(V vertex)
E
findEdge(V v1, V v2)
java.util.Collection<E>
findEdgeSet(V v1, V v2)
V
getDest(E directed_edge)
int
getEdgeCount()
java.util.Collection<E>
getEdges()
edu.uci.ics.jung.graph.util.Pair<V>
getEndpoints(E edge)
static <V,E>
org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.UndirectedGraph<V,E>>getFactory()
Returns aFactory
that creates an instance of this graph type.java.util.Collection<E>
getIncidentEdges(V vertex)
java.util.Collection<E>
getInEdges(V vertex)
java.util.Collection<V>
getNeighbors(V vertex)
java.util.Collection<E>
getOutEdges(V vertex)
java.util.Collection<V>
getPredecessors(V vertex)
V
getSource(E directed_edge)
java.util.Collection<V>
getSuccessors(V vertex)
int
getVertexCount()
java.util.Collection<V>
getVertices()
boolean
isDest(V vertex, E edge)
boolean
isSource(V vertex, E edge)
boolean
removeEdge(E edge)
boolean
removeVertex(V vertex)
-
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, 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
-
-
-
-
Method Detail
-
getFactory
public static <V,E> org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.UndirectedGraph<V,E>> getFactory()
Returns aFactory
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
-
addEdge
public boolean addEdge(E edge, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints, edu.uci.ics.jung.graph.util.EdgeType edgeType)
Description copied from class:AbstractGraph
Addsedge
to this graph with the specifiedendpoints
andEdgeType
.- Specified by:
addEdge
in classAbstractGraph<V,E>
- Returns:
- true iff the graph was modified as a result of this call
-
findEdgeSet
public java.util.Collection<E> findEdgeSet(V v1, V v2)
- Specified by:
findEdgeSet
in interfaceedu.uci.ics.jung.graph.Hypergraph<V,E>
- Overrides:
findEdgeSet
in classAbstractGraph<V,E>
-
getEdges
public java.util.Collection<E> getEdges()
-
getVertices
public java.util.Collection<V> getVertices()
-
containsVertex
public boolean containsVertex(V vertex)
-
containsEdge
public boolean containsEdge(E edge)
-
getEdgeCount
public int getEdgeCount()
-
getVertexCount
public int getVertexCount()
-
addVertex
public boolean addVertex(V vertex)
-
removeVertex
public boolean removeVertex(V vertex)
-
-