|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
N - node value typeE - edge value typepublic interface Graph<N,E>
Directed graph with typed values on nodes and edges.
| 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. |
|
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). |
|
| Method Detail |
|---|
boolean isEmpty()
int nodeCount()
Set<Node<N,E>> nodes()
nodeCount() == 0) but will not be null.
Collection<N> nodeValues()
nodeCount() == 0) but will not be null.
<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.
T - node map value typedefaultValue - default value for each node mapping
<Node<N, E>, T> with
the nodes in this graph as keysvoid forEachNode(UnaryProcedure<Node<N,E>> procedure)
procedure - procedure to apply, must not be null
void forEachNode(UnaryPredicate<Node<N,E>> predicate,
UnaryProcedure<Node<N,E>> procedure)
predicate - node predicate, must not be nullprocedure - procedure to apply, must not be nullvoid forEachNodeValue(UnaryProcedure<? super N> procedure)
procedure - procedure to apply, must not be null
void forEachNodeValue(UnaryPredicate<N> predicate,
UnaryProcedure<N> procedure)
predicate - node value predicate, must not be nullprocedure - procedure to apply, must not be nullint edgeCount()
Set<Edge<N,E>> edges()
edgeCount() == 0) but will not be null.
Collection<E> edgeValues()
edgeCount() == 0) but will not be null.
<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.
T - edge map value typedefaultValue - default value for each edge mapping
<Edge<N, E>, T> with
the edges in this graph as keysvoid forEachEdge(UnaryProcedure<Edge<N,E>> procedure)
procedure - procedure to apply, must not be null
void forEachEdge(UnaryPredicate<Edge<N,E>> predicate,
UnaryProcedure<Edge<N,E>> procedure)
predicate - edge predicate, must not be nullprocedure - procedure to apply, must not be nullvoid forEachEdgeValue(UnaryProcedure<? super E> procedure)
procedure - procedure to apply, must not be null
void forEachEdgeValue(UnaryPredicate<E> predicate,
UnaryProcedure<E> procedure)
predicate - edge value predicate, must not be nullprocedure - procedure to apply, must not be nullvoid clear()
UnsupportedOperationException - if the clear
operation is not supported by this graphNode<N,E> createNode(N value)
value - value
UnsupportedOperationException - if the createNode
operation is not supported by this graphvoid remove(Node<N,E> node)
node - node to remove, must not be null and must be
contained in this graph
UnsupportedOperationException - if the remove(Node)
operation is not supported by this graph
Edge<N,E> createEdge(Node<N,E> source,
Node<N,E> target,
E value)
value - valuesource - 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 graph
UnsupportedOperationException - if the createEdge
operation is not supported by this graphvoid remove(Edge<N,E> edge)
edge - edge to remove, must not be null and must be
contained in this graph
UnsupportedOperationException - if the remove(Edge)
operation is not supported by this graph
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||