|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.ics.jung.graph.AbstractGraph<V,E> edu.uci.ics.jung.graph.AbstractTypedGraph<V,E>
public abstract class AbstractTypedGraph<V,E>
An abstract class for graphs whose edges all have the same EdgeType
.
Intended to simplify the implementation of such graph classes.
Field Summary | |
---|---|
protected EdgeType |
edge_type
The edge type for all edges in this graph. |
Constructor Summary | |
---|---|
AbstractTypedGraph(EdgeType edge_type)
Creates an instance with the specified edge type. |
Method Summary | |
---|---|
EdgeType |
getDefaultEdgeType()
Returns this graph's edge type. |
int |
getEdgeCount(EdgeType edge_type)
Returns the edge count for this graph if edge_type matches
the edge type for this graph, and 0 otherwise. |
Collection<E> |
getEdges(EdgeType edge_type)
Returns the edge set for this graph if edgeType matches the
edge type for this graph, and an empty set otherwise. |
EdgeType |
getEdgeType(E e)
Returns this graph's edge type, or null if e is not
in this graph. |
protected boolean |
hasEqualEdgeType(EdgeType edge_type)
Returns true if edge_type matches the default edge type for
this graph, and false otherwise. |
protected void |
validateEdgeType(EdgeType edge_type)
Throws an IllegalArgumentException if edge_type does 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 |
Methods inherited from interface edu.uci.ics.jung.graph.Graph |
---|
getDest, getEndpoints, getInEdges, getOutEdges, getPredecessors, getSource, getSuccessors, isDest, isSource |
Methods inherited from interface edu.uci.ics.jung.graph.Hypergraph |
---|
addVertex, containsEdge, containsVertex, getEdgeCount, getEdges, getIncidentEdges, getNeighbors, getVertexCount, getVertices, removeEdge, removeVertex |
Field Detail |
---|
protected final EdgeType edge_type
Constructor Detail |
---|
public AbstractTypedGraph(EdgeType edge_type)
edge_type
- the type of edges that this graph acceptsMethod Detail |
---|
public EdgeType getDefaultEdgeType()
public EdgeType getEdgeType(E e)
null
if e
is not
in this graph.
EdgeType
of edge
, or null
if edge
has no defined typepublic Collection<E> getEdges(EdgeType edge_type)
edgeType
matches the
edge type for this graph, and an empty set otherwise.
edge_type
- the type of edges to be returned
edge_type
, or
null
if the graph does not accept edges of this typeEdgeType
public int getEdgeCount(EdgeType edge_type)
edge_type
matches
the edge type for this graph, and 0 otherwise.
edge_type
- the type of edge for which the count is to be returned
edge_type
in this graphprotected boolean hasEqualEdgeType(EdgeType edge_type)
true
if edge_type
matches the default edge type for
this graph, and false
otherwise.
edge_type
- the edge type to compare to this instance's default edge typeprotected void validateEdgeType(EdgeType edge_type)
IllegalArgumentException
if edge_type
does not
match the default edge type for this graph.
edge_type
- the edge type to compare to this instance's default edge type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |