public class SimpleDirectedSparseGraph<V,E extends DirectedEdge> extends SimpleAbstractSparseGraph<V,E> implements DirectedGraph<V,E>
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<E,Pair<V>> |
edges |
protected java.util.Map<V,Pair<java.util.Set<E>>> |
vertices |
Constructor and Description |
---|
SimpleDirectedSparseGraph() |
Modifier and Type | Method and Description |
---|---|
boolean |
addDirectedEdge(E edge,
V source,
V dest)
Adds
edge to the graph. |
boolean |
addVertex(V vertex) |
E |
findEdge(V v1,
V v2) |
V |
getDest(E edge) |
java.util.Collection |
getEdges() |
Pair<V> |
getEndpoints(E edge) |
java.util.Collection |
getIncidentEdges(V vertex) |
java.util.Collection<E> |
getInEdges(V vertex) |
java.util.Collection |
getNeighbors(V vertex) |
java.util.Collection<E> |
getOutEdges(V vertex) |
java.util.Collection<V> |
getPredecessors(V vertex) |
V |
getSource(E edge) |
java.util.Collection<V> |
getSuccessors(V vertex) |
java.util.Collection |
getVertices() |
boolean |
isDest(V vertex,
E edge) |
boolean |
isSource(V vertex,
E edge) |
boolean |
removeEdge(E edge) |
boolean |
removeVertex(V vertex) |
areIncident, areNeighbors, degree, getIncidentVertices, getOpposite, inDegree, isPredecessor, isSuccessor, numNeighbors, numPredecessors, numSuccessors, outDegree
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOpposite, inDegree, isPredecessor, isSuccessor, numPredecessors, numSuccessors, outDegree
areIncident, areNeighbors, degree, getIncidentVertices, numNeighbors
protected java.util.Map<V,Pair<java.util.Set<E extends DirectedEdge>>> vertices
protected java.util.Map<E extends DirectedEdge,Pair<V>> edges
public java.util.Collection getEdges()
getEdges
in interface ArchetypeGraph<V,E extends DirectedEdge>
public java.util.Collection getVertices()
getVertices
in interface ArchetypeGraph<V,E extends DirectedEdge>
public boolean addVertex(V vertex)
addVertex
in interface ArchetypeGraph<V,E extends DirectedEdge>
public boolean removeVertex(V vertex)
removeVertex
in interface ArchetypeGraph<V,E extends DirectedEdge>
public boolean removeEdge(E edge)
removeEdge
in interface ArchetypeGraph<V,E extends DirectedEdge>
public java.util.Collection<E> getInEdges(V vertex)
getInEdges
in interface Graph<V,E extends DirectedEdge>
public java.util.Collection<E> getOutEdges(V vertex)
getOutEdges
in interface Graph<V,E extends DirectedEdge>
public java.util.Collection<V> getPredecessors(V vertex)
getPredecessors
in interface Graph<V,E extends DirectedEdge>
public java.util.Collection<V> getSuccessors(V vertex)
getSuccessors
in interface Graph<V,E extends DirectedEdge>
public java.util.Collection getNeighbors(V vertex)
getNeighbors
in interface ArchetypeGraph<V,E extends DirectedEdge>
public java.util.Collection getIncidentEdges(V vertex)
getIncidentEdges
in interface ArchetypeGraph<V,E extends DirectedEdge>
public E findEdge(V v1, V v2)
findEdge
in interface ArchetypeGraph<V,E extends DirectedEdge>
public boolean addDirectedEdge(E edge, V source, V dest)
edge
to the graph. Also adds
source
and dest
to the graph if they
are not already present. Returns false
if
the specified edge isaddDirectedEdge
in interface DirectedGraph<V,E extends DirectedEdge>
public V getSource(E edge)
getSource
in interface DirectedGraph<V,E extends DirectedEdge>
public V getDest(E edge)
getDest
in interface DirectedGraph<V,E extends DirectedEdge>
public boolean isSource(V vertex, E edge)
isSource
in interface DirectedGraph<V,E extends DirectedEdge>
public boolean isDest(V vertex, E edge)
isDest
in interface DirectedGraph<V,E extends DirectedEdge>
public Pair<V> getEndpoints(E edge)
getEndpoints
in interface Graph<V,E extends DirectedEdge>