|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dishevelled.graph.impl.AbstractGraphDecorator<N,E>
N - node value typeE - edge value typepublic abstract class AbstractGraphDecorator<N,E>
Abstract graph that decorates an instance of Graph.
| Constructor Summary | |
|---|---|
protected |
AbstractGraphDecorator(Graph<N,E> graph)
Create a new abstract graph that decorates the specified graph. |
| Method Summary | ||
|---|---|---|
void |
clear()
Clear the nodes and edges in this graph (optional operation). |
|
Edge<N,E> |
createEdge(Node<N,E> source,
Node<N,E> target,
E value)
Create and return a new edge in this graph with the specified value connecting the specified source and target nodes (optional operation). |
|
Node<N,E> |
createNode(N value)
Create and return a new node in this graph with the specified value (optional operation). |
|
int |
edgeCount()
Return the number of edges in this graph. |
|
|
edgeMap(T defaultValue)
Return a map of type <Edge<N, E>, T> with
the edges in this graph as keys. |
|
Set<Edge<N,E>> |
edges()
Return a read-only set view of the edges in this graph. |
|
Collection<E> |
edgeValues()
Return a read-only collection view of the edge values in this graph. |
|
void |
forEachEdge(UnaryPredicate<Edge<N,E>> predicate,
UnaryProcedure<Edge<N,E>> procedure)
Apply the specified procedure to each edge in this graph accepted by the specified predicate. |
|
void |
forEachEdge(UnaryProcedure<Edge<N,E>> procedure)
Apply the specified procedure to each edge in this graph. |
|
void |
forEachEdgeValue(UnaryPredicate<E> predicate,
UnaryProcedure<E> procedure)
Apply the specified procedure to each edge value in this graph accepted by the specified predicate. |
|
void |
forEachEdgeValue(UnaryProcedure<? super E> procedure)
Apply the specified procedure to each edge value in this graph. |
|
void |
forEachNode(UnaryPredicate<Node<N,E>> predicate,
UnaryProcedure<Node<N,E>> procedure)
Apply the specified procedure to each node in this graph accepted by the specified predicate. |
|
void |
forEachNode(UnaryProcedure<Node<N,E>> procedure)
Apply the specified procedure to each node in this graph. |
|
void |
forEachNodeValue(UnaryPredicate<N> predicate,
UnaryProcedure<N> procedure)
Apply the specified procedure to each node value in this graph accepted by the specified predicate. |
|
void |
forEachNodeValue(UnaryProcedure<? super N> procedure)
Apply the specified procedure to each node value in this graph. |
|
protected Graph<N,E> |
getGraph()
Return a reference to the graph this decorator decorates. |
|
boolean |
isEmpty()
Return true if this graph is empty. |
|
int |
nodeCount()
Return the number of nodes in this graph. |
|
|
nodeMap(T defaultValue)
Return a map of type <Node<N, E>, T> with
the nodes in this graph as keys. |
|
Set<Node<N,E>> |
nodes()
Return a read-only set view of the nodes in this graph. |
|
Collection<N> |
nodeValues()
Return a read-only collection view of the node values in this graph. |
|
void |
remove(Edge<N,E> edge)
Remove the specified edge from this graph (optional operation). |
|
void |
remove(Node<N,E> node)
Remove the specified node and any edges connecting the node from this graph (optional operation). |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractGraphDecorator(Graph<N,E> graph)
graph - graph to decorate, must not be null| Method Detail |
|---|
protected final Graph<N,E> getGraph()
public boolean isEmpty()
isEmpty in interface Graph<N,E>public int nodeCount()
nodeCount in interface Graph<N,E>public Set<Node<N,E>> nodes()
nodeCount() == 0) but will not be null.
nodes in interface Graph<N,E>public Collection<N> nodeValues()
nodeCount() == 0) but will not be null.
nodeValues in interface Graph<N,E>public <T> Map<Node<N,E>,T> nodeMap(T defaultValue)
<Node<N, E>, T> with
the nodes in this graph as keys. The keys in the returned map
reference the nodes in this graph and are read-only. Each key maps to
the specified default value, which may be null. The map may be empty
(if nodeCount() == 0) but will not be null.
nodeMap in interface Graph<N,E>T - node map value typedefaultValue - default value for each node mapping
<Node<N, E>, T> with
the nodes in this graph as keyspublic void forEachNode(UnaryProcedure<Node<N,E>> procedure)
forEachNode in interface Graph<N,E>procedure - procedure to apply, must not be null
public void forEachNode(UnaryPredicate<Node<N,E>> predicate,
UnaryProcedure<Node<N,E>> procedure)
forEachNode in interface Graph<N,E>predicate - node predicate, must not be nullprocedure - procedure to apply, must not be nullpublic void forEachNodeValue(UnaryProcedure<? super N> procedure)
forEachNodeValue in interface Graph<N,E>procedure - procedure to apply, must not be null
public void forEachNodeValue(UnaryPredicate<N> predicate,
UnaryProcedure<N> procedure)
forEachNodeValue in interface Graph<N,E>predicate - node value predicate, must not be nullprocedure - procedure to apply, must not be nullpublic int edgeCount()
edgeCount in interface Graph<N,E>public Set<Edge<N,E>> edges()
edgeCount() == 0) but will not be null.
edges in interface Graph<N,E>public Collection<E> edgeValues()
edgeCount() == 0) but will not be null.
edgeValues in interface Graph<N,E>public <T> Map<Edge<N,E>,T> edgeMap(T defaultValue)
<Edge<N, E>, T> with
the edges in this graph as keys. The keys in the returned map
reference the edges in this graph and are read-only. Each key maps to
the specified default value, which may be null. The map may be empty
(if edgeCount() == 0) but will not be null.
edgeMap in interface Graph<N,E>T - edge map value typedefaultValue - default value for each edge mapping
<Edge<N, E>, T> with
the edges in this graph as keyspublic void forEachEdge(UnaryProcedure<Edge<N,E>> procedure)
forEachEdge in interface Graph<N,E>procedure - procedure to apply, must not be null
public void forEachEdge(UnaryPredicate<Edge<N,E>> predicate,
UnaryProcedure<Edge<N,E>> procedure)
forEachEdge in interface Graph<N,E>predicate - edge predicate, must not be nullprocedure - procedure to apply, must not be nullpublic void forEachEdgeValue(UnaryProcedure<? super E> procedure)
forEachEdgeValue in interface Graph<N,E>procedure - procedure to apply, must not be null
public void forEachEdgeValue(UnaryPredicate<E> predicate,
UnaryProcedure<E> procedure)
forEachEdgeValue in interface Graph<N,E>predicate - edge value predicate, must not be nullprocedure - procedure to apply, must not be nullpublic void clear()
clear in interface Graph<N,E>public Node<N,E> createNode(N value)
createNode in interface Graph<N,E>value - value
public void remove(Node<N,E> node)
remove in interface Graph<N,E>node - node to remove, must not be null and must be
contained in this graph
public Edge<N,E> createEdge(Node<N,E> source,
Node<N,E> target,
E value)
createEdge in interface Graph<N,E>source - source node, must not be null and must be
contained in this graphtarget - target node, must not be null and must be
contained in this graphvalue - value
public void remove(Edge<N,E> edge)
remove in interface Graph<N,E>edge - edge to remove, must not be null and must be
contained in this graph
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||