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:
- Graph<V,E>, 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
-
-
Constructor Summary
Constructors Constructor and Description AbstractTypedGraph(EdgeType edge_type)Creates an instance with the specified edge type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description EdgeTypegetDefaultEdgeType()Returns this graph's edge type.intgetEdgeCount(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(EdgeType edge_type)Returns the edge set for this graph ifedgeTypematches the edge type for this graph, and an empty set otherwise.EdgeTypegetEdgeType(E e)Returns this graph's edge type, ornullifeis not in 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, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree, toString
-
Methods inherited from class java.lang.Object
equals, 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
-
-
-
-
Constructor Detail
-
AbstractTypedGraph
public AbstractTypedGraph(EdgeType edge_type)
Creates an instance with the specified edge type.- Parameters:
edge_type- the type of edges that this graph accepts
-
-
Method Detail
-
getDefaultEdgeType
public EdgeType getDefaultEdgeType()
Returns this graph's edge type.- Returns:
- the default edge type for this graph
-
getEdgeType
public EdgeType getEdgeType(E e)
Returns this graph's edge type, ornullifeis not in this graph.- Parameters:
e- the edge whose type is to be returned- Returns:
- the
EdgeTypeofedge, ornullifedgehas no defined type
-
getEdges
public java.util.Collection<E> getEdges(EdgeType edge_type)
Returns the edge set for this graph ifedgeTypematches the edge type for this graph, and an empty set otherwise.- Parameters:
edge_type- the type of edges to be returned- Returns:
- the collection of edges which are of type
edge_type, ornullif the graph does not accept edges of this type - See Also:
EdgeType
-
getEdgeCount
public int getEdgeCount(EdgeType edge_type)
Returns the edge count for this graph ifedge_typematches the edge type for this graph, and 0 otherwise.- Parameters:
edge_type- the type of edge for which the count is to be returned- Returns:
- the number of edges of type
edge_typein this graph
-
-
DataMelt 3.0 © DataMelt by jWork.ORG