Package edu.uci.ics.jung.graph
Class AbstractGraph<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.graph.AbstractGraph<V,E>
-
- All Implemented Interfaces:
edu.uci.ics.jung.graph.Graph<V,E>
,edu.uci.ics.jung.graph.Hypergraph<V,E>
,java.io.Serializable
- Direct Known Subclasses:
AbstractTypedGraph
,SparseGraph
,SparseMultigraph
public abstract class AbstractGraph<V,E> extends java.lang.Object implements edu.uci.ics.jung.graph.Graph<V,E>, java.io.Serializable
Abstract implementation of theGraph
interface. Designed to simplify implementation of new graph classes.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractGraph()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
addEdge(E edge, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints)
Addsedge
to this graph with the specifiedendpoints
, with the default edge type.abstract 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
addEdge(E edge, java.util.Collection<? extends V> vertices)
boolean
addEdge(E edge, java.util.Collection<? extends V> vertices, edu.uci.ics.jung.graph.util.EdgeType edgeType)
boolean
addEdge(E e, V v1, V v2)
boolean
addEdge(E e, V v1, V v2, edu.uci.ics.jung.graph.util.EdgeType edge_type)
int
degree(V vertex)
E
findEdge(V v1, V v2)
java.util.Collection<E>
findEdgeSet(V v1, V v2)
int
getIncidentCount(E edge)
java.util.Collection<V>
getIncidentVertices(E edge)
int
getNeighborCount(V vertex)
V
getOpposite(V vertex, E edge)
int
getPredecessorCount(V vertex)
int
getSuccessorCount(V vertex)
protected edu.uci.ics.jung.graph.util.Pair<V>
getValidatedEndpoints(E edge, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints)
int
inDegree(V vertex)
boolean
isIncident(V vertex, E edge)
boolean
isNeighbor(V v1, V v2)
boolean
isPredecessor(V v1, V v2)
boolean
isSuccessor(V v1, V v2)
int
outDegree(V vertex)
java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
addEdge
public boolean addEdge(E edge, java.util.Collection<? extends V> vertices, edu.uci.ics.jung.graph.util.EdgeType edgeType)
-
addEdge
public boolean addEdge(E edge, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints)
Addsedge
to this graph with the specifiedendpoints
, with the default edge type.- Returns:
- true iff the graph was modified as a result of this call
-
addEdge
public abstract 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
.- Returns:
- true iff the graph was modified as a result of this call
-
getValidatedEndpoints
protected edu.uci.ics.jung.graph.util.Pair<V> getValidatedEndpoints(E edge, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints)
-
inDegree
public int inDegree(V vertex)
-
outDegree
public int outDegree(V vertex)
-
getPredecessorCount
public int getPredecessorCount(V vertex)
-
getSuccessorCount
public int getSuccessorCount(V vertex)
-
getNeighborCount
public int getNeighborCount(V vertex)
-
degree
public int degree(V vertex)
-
getIncidentCount
public int getIncidentCount(E edge)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-