public class SparseGraph<V,E>
extends edu.uci.ics.jung.graph.AbstractGraph<V,E>
implements edu.uci.ics.jung.graph.Graph<V,E>
Graph
that is suitable for sparse graphs and
permits both directed and undirected edges.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<E,edu.uci.ics.jung.graph.util.Pair<V>> |
directed_edges |
protected static int |
INCIDENT |
protected static int |
INCOMING |
protected static int |
OUTGOING |
protected java.util.Map<E,edu.uci.ics.jung.graph.util.Pair<V>> |
undirected_edges |
protected java.util.Map<V,java.util.Map<V,E>[]> |
vertex_maps |
Constructor and Description |
---|
SparseGraph()
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addEdge(E edge,
edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints,
edu.uci.ics.jung.graph.util.EdgeType edgeType) |
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) |
edu.uci.ics.jung.graph.util.EdgeType |
getDefaultEdgeType() |
V |
getDest(E directed_edge) |
int |
getEdgeCount() |
int |
getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType edge_type) |
java.util.Collection<E> |
getEdges() |
java.util.Collection<E> |
getEdges(edu.uci.ics.jung.graph.util.EdgeType edgeType) |
edu.uci.ics.jung.graph.util.EdgeType |
getEdgeType(E edge) |
edu.uci.ics.jung.graph.util.Pair<V> |
getEndpoints(E edge) |
static <V,E> org.apache.commons.collections15.Factory<edu.uci.ics.jung.graph.Graph<V,E>> |
getFactory()
Returns a
Factory 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) |
addEdge, addEdge, addEdge, addEdge, addEdge, degree, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected static final int INCOMING
protected static final int OUTGOING
protected static final int INCIDENT
public static <V,E> org.apache.commons.collections15.Factory<edu.uci.ics.jung.graph.Graph<V,E>> getFactory()
Factory
that creates an instance of this graph type.V
- the vertex type for the graph factoryE
- the edge type for the graph factorypublic boolean addEdge(E edge, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints, edu.uci.ics.jung.graph.util.EdgeType edgeType)
public java.util.Collection<E> getEdges(edu.uci.ics.jung.graph.util.EdgeType edgeType)
public edu.uci.ics.jung.graph.util.EdgeType getEdgeType(E edge)
public java.util.Collection<E> getEdges()
public java.util.Collection<V> getVertices()
public boolean containsVertex(V vertex)
public boolean containsEdge(E edge)
public int getEdgeCount()
public int getVertexCount()
public boolean addVertex(V vertex)
public boolean removeVertex(V vertex)
public boolean removeEdge(E edge)
public int getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType edge_type)