public abstract class AbstractTypedGraph<V,E> extends AbstractGraph<V,E>
EdgeType.
Intended to simplify the implementation of such graph classes.| Modifier and Type | Field and Description |
|---|---|
protected EdgeType |
edge_type
The edge type for all edges in this graph.
|
| Constructor and Description |
|---|
AbstractTypedGraph(EdgeType edge_type)
Creates an instance with the specified edge type.
|
| Modifier and Type | Method and Description |
|---|---|
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) |
protected void |
validateEdgeType(EdgeType edge_type)
Throws an
IllegalArgumentException if edge_type does not
match the default edge type for this graph. |
addEdge, addEdge, addEdge, addEdge, addEdge, addEdge, degree, findEdge, findEdgeSet, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDest, getEndpoints, getInEdges, getOutEdges, getPredecessors, getSource, getSuccessors, isDest, isSourceaddVertex, containsEdge, containsVertex, getEdgeCount, getEdges, getIncidentEdges, getNeighbors, getVertexCount, getVertices, removeEdge, removeVertexprotected final EdgeType edge_type
public AbstractTypedGraph(EdgeType edge_type)
edge_type - the type of edges that this graph acceptspublic EdgeType getDefaultEdgeType()
public EdgeType getEdgeType(E e)
null if e is not
in this graph.public Collection<E> getEdges(EdgeType edge_type)
edgeType matches the
edge type for this graph, and an empty set otherwise.public int getEdgeCount(EdgeType edge_type)
edge_type matches
the edge type for this graph, and 0 otherwise.protected boolean hasEqualEdgeType(EdgeType edge_type)
edge_type - the edge type to compare to this instance's default edge typetrue if edge_type matches the default edge type for
this graph, and false otherwiseprotected 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 typeCopyright © 2016. All rights reserved.