public abstract class AbstractGraph<V,E> extends Object implements Graph<V,E>, Serializable
Graph interface.
Designed to simplify implementation of new graph classes.| Constructor and Description |
|---|
AbstractGraph() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEdge(E edge,
Collection<? extends V> vertices) |
boolean |
addEdge(E edge,
Collection<? extends V> vertices,
EdgeType edgeType) |
boolean |
addEdge(E edge,
Pair<? extends V> endpoints)
Adds
edge to this graph with the specified endpoints,
with the default edge type. |
abstract boolean |
addEdge(E edge,
Pair<? extends V> endpoints,
EdgeType edgeType)
Adds
edge to this graph with the specified endpoints
and EdgeType. |
boolean |
addEdge(E e,
V v1,
V v2) |
boolean |
addEdge(E e,
V v1,
V v2,
EdgeType edge_type) |
int |
degree(V vertex) |
E |
findEdge(V v1,
V v2) |
Collection<E> |
findEdgeSet(V v1,
V v2) |
int |
getIncidentCount(E edge) |
Collection<V> |
getIncidentVertices(E edge) |
int |
getNeighborCount(V vertex) |
V |
getOpposite(V vertex,
E edge) |
int |
getPredecessorCount(V vertex) |
int |
getSuccessorCount(V vertex) |
protected Pair<V> |
getValidatedEndpoints(E edge,
Pair<? extends V> endpoints) |
int |
inDegree(V vertex) |
boolean |
isIncident(V vertex,
E edge) |
boolean |
isNeighbor(V v1,
V v2) |
boolean |
isPredecessor(V v1,
V v2) |
boolean |
isSuccessor(V v1,
V v2) |
int |
outDegree(V vertex) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDest, getEndpoints, getInEdges, getOutEdges, getPredecessors, getSource, getSuccessors, isDest, isSourceaddVertex, containsEdge, containsVertex, getDefaultEdgeType, getEdgeCount, getEdgeCount, getEdges, getEdges, getEdgeType, getIncidentEdges, getNeighbors, getVertexCount, getVertices, removeEdge, removeVertexpublic boolean addEdge(E edge, Collection<? extends V> vertices)
addEdge in interface Hypergraph<V,E>public boolean addEdge(E edge, Collection<? extends V> vertices, EdgeType edgeType)
addEdge in interface Hypergraph<V,E>public boolean addEdge(E edge, Pair<? extends V> endpoints)
edge to this graph with the specified endpoints,
with the default edge type.edge - the edge to be addedendpoints - the endpoints to be connected to this edgetrue iff the graph was modified as a result of this callpublic abstract boolean addEdge(E edge, Pair<? extends V> endpoints, EdgeType edgeType)
edge to this graph with the specified endpoints
and EdgeType.edge - the edge to be addedendpoints - the endpoints to be connected to this edgeedgeType - the type of edge to addpublic int inDegree(V vertex)
public int outDegree(V vertex)
public boolean isPredecessor(V v1, V v2)
isPredecessor in interface Graph<V,E>public boolean isSuccessor(V v1, V v2)
isSuccessor in interface Graph<V,E>public int getPredecessorCount(V vertex)
getPredecessorCount in interface Graph<V,E>public int getSuccessorCount(V vertex)
getSuccessorCount in interface Graph<V,E>public boolean isNeighbor(V v1, V v2)
isNeighbor in interface Hypergraph<V,E>public boolean isIncident(V vertex, E edge)
isIncident in interface Hypergraph<V,E>public int getNeighborCount(V vertex)
getNeighborCount in interface Hypergraph<V,E>public int degree(V vertex)
degree in interface Hypergraph<V,E>public int getIncidentCount(E edge)
getIncidentCount in interface Hypergraph<V,E>public V getOpposite(V vertex, E edge)
getOpposite in interface Graph<V,E>public Collection<E> findEdgeSet(V v1, V v2)
findEdgeSet in interface Hypergraph<V,E>public Collection<V> getIncidentVertices(E edge)
getIncidentVertices in interface Hypergraph<V,E>Copyright © 2016. All rights reserved.