Package edu.uci.ics.jung.graph
Class DirectedSparseMultigraph<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.DirectedSparseMultigraph<V,E>
-
- All Implemented Interfaces:
edu.uci.ics.jung.graph.DirectedGraph<V,E>,edu.uci.ics.jung.graph.Graph<V,E>,edu.uci.ics.jung.graph.Hypergraph<V,E>,edu.uci.ics.jung.graph.MultiGraph<V,E>,java.io.Serializable
- Direct Known Subclasses:
DirectedOrderedSparseMultigraph
public class DirectedSparseMultigraph<V,E> extends AbstractTypedGraph<V,E> implements edu.uci.ics.jung.graph.DirectedGraph<V,E>, edu.uci.ics.jung.graph.MultiGraph<V,E>
An implementation ofDirectedGraph, suitable for sparse graphs, that permits parallel edges.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DirectedSparseMultigraph()Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddEdge(E edge, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints, edu.uci.ics.jung.graph.util.EdgeType edgeType)Addsedgeto this graph with the specifiedendpointsandEdgeType.booleanaddVertex(V vertex)booleancontainsEdge(E edge)booleancontainsVertex(V vertex)EfindEdge(V v1, V v2)VgetDest(E edge)intgetEdgeCount()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.DirectedGraph<V,E>>getFactory()Returns aFactorythat creates an instance of this graph type.java.util.Collection<E>getIncidentEdges(V vertex)protected java.util.Collection<E>getIncoming_internal(V vertex)java.util.Collection<E>getInEdges(V vertex)java.util.Collection<V>getNeighbors(V vertex)java.util.Collection<E>getOutEdges(V vertex)protected java.util.Collection<E>getOutgoing_internal(V vertex)java.util.Collection<V>getPredecessors(V vertex)VgetSource(E edge)java.util.Collection<V>getSuccessors(V vertex)intgetVertexCount()java.util.Collection<V>getVertices()booleanisDest(V vertex, E edge)booleanisSource(V vertex, E edge)booleanremoveEdge(E edge)booleanremoveVertex(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, 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
-
-
-
-
Method Detail
-
getFactory
public static <V,E> org.apache.commons.collections4.Factory<edu.uci.ics.jung.graph.DirectedGraph<V,E>> getFactory()
Returns aFactorythat creates an instance of this graph type.- Type Parameters:
V- the vertex type for the graph factoryE- the edge type for the graph factory
-
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)
-
addVertex
public boolean addVertex(V vertex)
-
removeVertex
public boolean removeVertex(V vertex)
-
removeEdge
public boolean removeEdge(E edge)
-
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:AbstractGraphAddsedgeto this graph with the specifiedendpointsandEdgeType.- Specified by:
addEdgein classAbstractGraph<V,E>- Returns:
- true iff the graph was modified as a result of this call
-
getEdgeCount
public int getEdgeCount()
-
-