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.SerializableAbstract implementation of theGraphinterface. 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 booleanaddEdge(E edge, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints)Addsedgeto this graph with the specifiedendpoints, with the default edge type.abstract 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.booleanaddEdge(E edge, java.util.Collection<? extends V> vertices)booleanaddEdge(E edge, java.util.Collection<? extends V> vertices, edu.uci.ics.jung.graph.util.EdgeType edgeType)booleanaddEdge(E e, V v1, V v2)booleanaddEdge(E e, V v1, V v2, edu.uci.ics.jung.graph.util.EdgeType edge_type)intdegree(V vertex)EfindEdge(V v1, V v2)java.util.Collection<E>findEdgeSet(V v1, V v2)intgetIncidentCount(E edge)java.util.Collection<V>getIncidentVertices(E edge)intgetNeighborCount(V vertex)VgetOpposite(V vertex, E edge)intgetPredecessorCount(V vertex)intgetSuccessorCount(V vertex)protected edu.uci.ics.jung.graph.util.Pair<V>getValidatedEndpoints(E edge, edu.uci.ics.jung.graph.util.Pair<? extends V> endpoints)intinDegree(V vertex)booleanisIncident(V vertex, E edge)booleanisNeighbor(V v1, V v2)booleanisPredecessor(V v1, V v2)booleanisSuccessor(V v1, V v2)intoutDegree(V vertex)java.lang.StringtoString()-
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)
Addsedgeto 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)
Addsedgeto this graph with the specifiedendpointsandEdgeType.- 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:
toStringin classjava.lang.Object
-
-