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 |
edgeType
The edge type for all edges in this graph.
|
Constructor and Description |
---|
AbstractTypedGraph(EdgeType edgeType)
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 edgeType)
Returns the edge count for this graph if
edge_type matches
the edge type for this graph, and 0 otherwise. |
java.util.Collection<E> |
getEdges(EdgeType edgeType)
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 edgeType)
Returns
true if edge_type matches the default edge type for
this graph, and false otherwise. |
protected void |
validateEdgeType(EdgeType edgeType)
Throws an
IllegalArgumentException if edge_type does not
match the default edge type for this graph. |
addEdge, addEdge, addEdgeWithEndPoints, addEdgeWithEndpoints, addEdgeWithVertices, addEdgeWithVertices, degree, findEdge, findEdgeSet, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDest, getEndpoints, getInEdges, getOutEdges, getPredecessors, getSource, getSuccessors, isDest, isSource
addVertex, containsEdge, containsVertex, getEdgeCount, getEdgesView, getIncidentEdges, getNeighbors, getVertexCount, getVerticesView, removeEdge, removeVertex
protected final EdgeType edgeType
public AbstractTypedGraph(EdgeType edgeType)
edgeType
- the type of edges that this graph acceptspublic 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 java.util.Collection<E> getEdges(EdgeType edgeType)
edgeType
matches the
edge type for this graph, and an empty set otherwise.edgeType
- the type of edges to be returnededge_type
, or
null
if the graph does not accept edges of this typeEdgeType
public int getEdgeCount(EdgeType edgeType)
edge_type
matches
the edge type for this graph, and 0 otherwise.edgeType
- the type of edge for which the count is to be returnededge_type
in this graphprotected boolean hasEqualEdgeType(EdgeType edgeType)
true
if edge_type
matches the default edge type for
this graph, and false
otherwise.edgeType
- the edge type to compare to this instance's default edge typeprotected void validateEdgeType(EdgeType edgeType)
IllegalArgumentException
if edge_type
does not
match the default edge type for this graph.edgeType
- the edge type to compare to this instance's default edge typeCopyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence