Package edu.uci.ics.jung.graph
Class AbstractTypedGraph<V,E>
- java.lang.Object
-
- edu.uci.ics.jung.graph.AbstractGraph<V,E>
-
- edu.uci.ics.jung.graph.AbstractTypedGraph<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:
DirectedSparseGraph,DirectedSparseMultigraph,OrderedKAryTree,UndirectedSparseGraph,UndirectedSparseMultigraph
public abstract class AbstractTypedGraph<V,E> extends AbstractGraph<V,E>
An abstract class for graphs whose edges all have the sameEdgeType. Intended to simplify the implementation of such graph classes.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected edu.uci.ics.jung.graph.util.EdgeTypeedge_typeThe edge type for all edges in this graph.
-
Constructor Summary
Constructors Constructor Description AbstractTypedGraph(edu.uci.ics.jung.graph.util.EdgeType edge_type)Creates an instance with the specified edge type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description edu.uci.ics.jung.graph.util.EdgeTypegetDefaultEdgeType()Returns this graph's edge type.intgetEdgeCount(edu.uci.ics.jung.graph.util.EdgeType edge_type)Returns the edge count for this graph ifedge_typematches the edge type for this graph, and 0 otherwise.java.util.Collection<E>getEdges(edu.uci.ics.jung.graph.util.EdgeType edge_type)Returns the edge set for this graph ifedgeTypematches the edge type for this graph, and an empty set otherwise.edu.uci.ics.jung.graph.util.EdgeTypegetEdgeType(E e)Returns this graph's edge type, ornullifeis not in this graph.protected booleanhasEqualEdgeType(edu.uci.ics.jung.graph.util.EdgeType edge_type)Returnstrueifedge_typematches the default edge type for this graph, andfalseotherwise.protected voidvalidateEdgeType(edu.uci.ics.jung.graph.util.EdgeType edge_type)Throws anIllegalArgumentExceptionifedge_typedoes not match the default edge type for this graph.-
Methods inherited from class edu.uci.ics.jung.graph.AbstractGraph
addEdge, addEdge, addEdge, addEdge, addEdge, addEdge, degree, findEdge, 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
-
getDefaultEdgeType
public edu.uci.ics.jung.graph.util.EdgeType getDefaultEdgeType()
Returns this graph's edge type.
-
getEdgeType
public edu.uci.ics.jung.graph.util.EdgeType getEdgeType(E e)
Returns this graph's edge type, ornullifeis not in this graph.
-
getEdges
public java.util.Collection<E> getEdges(edu.uci.ics.jung.graph.util.EdgeType edge_type)
Returns the edge set for this graph ifedgeTypematches the edge type for this graph, and an empty set otherwise.
-
getEdgeCount
public int getEdgeCount(edu.uci.ics.jung.graph.util.EdgeType edge_type)
Returns the edge count for this graph ifedge_typematches the edge type for this graph, and 0 otherwise.
-
hasEqualEdgeType
protected boolean hasEqualEdgeType(edu.uci.ics.jung.graph.util.EdgeType edge_type)
Returnstrueifedge_typematches the default edge type for this graph, andfalseotherwise.- Parameters:
edge_type- the edge type to compare to this instance's default edge type
-
validateEdgeType
protected void validateEdgeType(edu.uci.ics.jung.graph.util.EdgeType edge_type)
Throws anIllegalArgumentExceptionifedge_typedoes not match the default edge type for this graph.- Parameters:
edge_type- the edge type to compare to this instance's default edge type
-
-