GraphConnections for directed graphs.
| Modifier and Type | Class and Description |
|---|---|
| private abstract static class | DirectedGraphConnections.NodeConnection<N>
A value class representing single connection between the origin node and another node. |
| private static class | DirectedGraphConnections.PredAndSucc
A wrapper class to indicate a node is both a predecessor and successor while still providing the successor value. |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final List | orderedNodeConnections
All node connections in this graph, in edge insertion order. |
| private static final Object | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| private | DirectedGraphConnections(Map<N, Object> adjacentNodeValues, List<DirectedGraphConnections.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | addPredecessor(N node, V unused)
Implements com. node as a predecessor to the origin node.
|
| public V | addSuccessor(N node, V value)
Implements com. node as a successor to the origin node.
|
| public Set | |
| public Iterator | incidentEdgeIterator(N
The node that this all of the connections in this class are connected to. thisNode)Implements com. |
| private static boolean | |
| private static boolean | |
| pack-priv static <N, V> DirectedGraphConnections | |
| pack-priv static <N, V> DirectedGraphConnections | ofImmutable(N thisNode, Iterable<EndpointPair<N>> incidentEdges, Function<N, V> successorNodeToValueFn)
|
| public Set | |
| public void | removePredecessor(N node)
Implements com. node from the set of predecessors.
|
| public V | removeSuccessor(Object node)
Implements com. node from the set of successors.
|
| public Set | |
| public V | value(N node)
Implements com. node, or null
if there is no such edge.
|
| adjacentNodeValues | back to summary |
|---|---|
| private final Map<N, Object> adjacentNodeValues | |
| orderedNodeConnections | back to summary |
|---|---|
| private final List<DirectedGraphConnections. All node connections in this graph, in edge insertion order. Note This field and | |
| PRED | back to summary |
|---|---|
| private static final Object PRED | |
| predecessorCount | back to summary |
|---|---|
| private int predecessorCount | |
| successorCount | back to summary |
|---|---|
| private int successorCount | |
| DirectedGraphConnections | back to summary |
|---|---|
| private DirectedGraphConnections(Map<N, Object> adjacentNodeValues, List<DirectedGraphConnections. | |
| addPredecessor | back to summary |
|---|---|
| public void addPredecessor(N node, V unused) Implements com. Doc from com. Add
| |
| addSuccessor | back to summary |
|---|---|
| public V addSuccessor(N node, V value) Implements com. Doc from com. Add
| |
| adjacentNodes | back to summary |
|---|---|
| public Set Implements com.
| |
| incidentEdgeIterator | back to summary |
|---|---|
| public Iterator Implements com. Doc from com. Returns an iterator over the incident edges.
| |
| isPredecessor | back to summary |
|---|---|
| private static boolean isPredecessor(Object value) | |
| isSuccessor | back to summary |
|---|---|
| private static boolean isSuccessor(Object value) | |
| of | back to summary |
|---|---|
| pack-priv static <N, V> DirectedGraphConnections | |
| ofImmutable | back to summary |
|---|---|
| pack-priv static <N, V> DirectedGraphConnections | |
| predecessors | back to summary |
|---|---|
| public Set Implements com.
| |
| removePredecessor | back to summary |
|---|---|
| public void removePredecessor(N node) Implements com. Doc from com. Remove
| |
| removeSuccessor | back to summary |
|---|---|
| public V removeSuccessor(Object node) Implements com. Doc from com. Remove
| |
| successors | back to summary |
|---|---|
| public Set Implements com.
| |
| value | back to summary |
|---|---|
| public V value(N node) Implements com. Doc from com. Returns the value associated with the edge connecting the origin node to
| |
There can be two types of connections (predecessor and successor), which is represented by the two implementations.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final N |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| node | back to summary |
|---|---|
| pack-priv final N node | |
| NodeConnection | back to summary |
|---|---|
| pack-priv NodeConnection(N node) | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. that)Overrides java. |
| public int |
| Pred | back to summary |
|---|---|
| pack-priv Pred(N node) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object that) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. that)Overrides java. |
| public int |
| Succ | back to summary |
|---|---|
| pack-priv Succ(N node) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object that) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Object |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| successorValue | back to summary |
|---|---|
| private final Object successorValue | |
| PredAndSucc | back to summary |
|---|---|
| pack-priv PredAndSucc(Object successorValue) | |