N - Node parameter typeV - Value parameter typeinterface GraphConnections<N,V>
Graph.| Modifier and Type | Method and Description |
|---|---|
void |
addPredecessor(N node,
V value)
Add
node as a predecessor to the origin node. |
V |
addSuccessor(N node,
V value)
Add
node as a successor to the origin node. |
java.util.Set<N> |
adjacentNodes() |
java.util.Set<N> |
predecessors() |
void |
removePredecessor(N node)
Remove
node from the set of predecessors. |
V |
removeSuccessor(N node)
Remove
node from the set of successors. |
java.util.Set<N> |
successors() |
V |
value(N node)
Returns the value associated with the edge connecting the origin node to
node, or null
if there is no such edge. |
java.util.Set<N> adjacentNodes()
java.util.Set<N> predecessors()
java.util.Set<N> successors()
V value(N node)
node, or null
if there is no such edge.void removePredecessor(N node)
node from the set of predecessors.V removeSuccessor(N node)
node from the set of successors. Returns the value previously associated with
the edge connecting the two nodes.void addPredecessor(N node, V value)
node as a predecessor to the origin node. In the case of an undirected graph, it
also becomes a successor. Associates value with the edge connecting the two nodes.