Object containing user data associated with the node,
each node maintains a Sets of nodes which are pointed
to by the current node (available from getOutNodes).
The in-degree of the node (that is, number of nodes that point to
the current node) may be queried.
| Modifier and Type | Field and Description |
|---|---|
| protected E | data
The data associated with this node. |
| protected int | inDegree
The in-degree of the node. |
| private Set | inNodes
A |
| protected Set | outNodes
A |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 9 for interoperability. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the node was not previously the
target of an edge.a node)DigraphNode.Adds a directed edge to the graph. |
| private void | |
| public void | |
| public E | |
| public int | |
| public Iterator | |
| public boolean | Returns: true if the node is the target of an edge.a node)DigraphNode.Returns |
| private void | |
| public boolean | Returns: true if the node was previously the target
of an edge.Removes a directed edge from the graph. |
| data | back to summary |
|---|---|
| protected E data The data associated with this node.
| |
| inDegree | back to summary |
|---|---|
| protected int inDegree The in-degree of the node. | |
| inNodes | back to summary |
|---|---|
| private Set<DigraphNode<E>> inNodes A
| |
| outNodes | back to summary |
|---|---|
| protected Set<DigraphNode<E>> outNodes A
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Use serialVersionUID from JDK 9 for interoperability. | |
| DigraphNode | back to summary |
|---|---|
| public DigraphNode(E data) | |
| addEdge | back to summary |
|---|---|
| public boolean addEdge(DigraphNode<E> node) Adds a directed edge to the graph. The outNodes list of this node is updated and the in-degree of the other node is incremented.
| |
| decrementInDegree | back to summary |
|---|---|
| private void decrementInDegree() Decrements the in-degree of this node. | |
| dispose | back to summary |
|---|---|
| public void dispose() Removes this node from the graph, updating neighboring nodes appropriately. | |
| getData | back to summary |
|---|---|
| public E getData() Returns the | |
| getInDegree | back to summary |
|---|---|
| public int getInDegree() Returns the in-degree of this node. | |
| getOutNodes | back to summary |
|---|---|
| public Iterator Returns an | |
| hasEdge | back to summary |
|---|---|
| public boolean hasEdge(DigraphNode<E> node) Returns
| |
| incrementInDegree | back to summary |
|---|---|
| private void incrementInDegree() Increments the in-degree of this node. | |
| removeEdge | back to summary |
|---|---|
| public boolean removeEdge(DigraphNode<E> node) Removes a directed edge from the graph. The outNodes list of this node is updated and the in-degree of the other node is decremented.
| |