|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Util.Collections.AbstractGraph<N,E>
public abstract class AbstractGraph<N extends AbstractGraph.Node<N,E>,E extends Graph.Edge<N,E>>
An AbstractGraph
provides a basic implementation
of the Graph
interface.
Nested Class Summary | |
---|---|
static class |
AbstractGraph.Edge<N extends AbstractGraph.Node<N,E>,E extends AbstractGraph.Edge<N,E>>
AbstractGraph.Edge provides a basic implementation of
the Graph.Edge interface. |
static class |
AbstractGraph.Node<N extends AbstractGraph.Node<N,E>,E extends Graph.Edge<N,E>>
AbstractGraph.Node provides a basic implementation of
the Graph.Node interface. |
Constructor Summary | |
---|---|
protected |
AbstractGraph()
|
Method Summary | |
---|---|
protected void |
addEdge(E e)
|
abstract E |
addEdge(N from,
N to)
Add an edge from from to to and return
the new edge. |
void |
addNode(N n)
Add a new node to the graph. |
Set<N> |
nodes()
Return the set of nodes comprising this Graph. |
void |
removeEdge(E e)
Remove the given edge from the graph. |
void |
summarize(Collection<N> nodesToRemove)
Remove all specified nodes, preserving path information. |
void |
summarize(N nodeToRemove)
Remove the given node, preserving edges: if A->N->B, then after removing N there is an edge A->B. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractGraph()
Method Detail |
---|
public Set<N> nodes()
Graph
nodes
in interface Graph<N extends AbstractGraph.Node<N,E>,E extends Graph.Edge<N,E>>
public void summarize(Collection<N> nodesToRemove)
MutableGraph
summarize
in interface MutableGraph<N extends AbstractGraph.Node<N,E>,E extends Graph.Edge<N,E>>
public void summarize(N nodeToRemove)
MutableGraph
summarize
in interface MutableGraph<N extends AbstractGraph.Node<N,E>,E extends Graph.Edge<N,E>>
public abstract E addEdge(N from, N to)
MutableGraph
from
to to
and return
the new edge.
addEdge
in interface MutableGraph<N extends AbstractGraph.Node<N,E>,E extends Graph.Edge<N,E>>
public void addNode(N n)
MutableGraph
addNode
in interface MutableGraph<N extends AbstractGraph.Node<N,E>,E extends Graph.Edge<N,E>>
protected void addEdge(E e)
public void removeEdge(E e)
MutableGraph
removeEdge
in interface MutableGraph<N extends AbstractGraph.Node<N,E>,E extends Graph.Edge<N,E>>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |