- java.lang.Object
-
- org.jgrapht.alg.connectivity.TreeDynamicConnectivity.Node
-
- Enclosing class:
- TreeDynamicConnectivity<T>
private class TreeDynamicConnectivity.Node extends java.lang.Object
An internal representation of the tree nodes.Keeps track of the node values and outgoing arcs. The outgoing arcs are placed according to the order they are traversed in the Euler tour
-
-
Field Summary
Fields Modifier and Type Field Description (package private) DoublyLinkedList<TreeDynamicConnectivity.Arc>
arcs
Arcs list(package private) java.util.Map<TreeDynamicConnectivity.Node,TreeDynamicConnectivity.Arc>
targetMap
Target node to arc mapping(package private) T
value
Node value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addArcAfter(TreeDynamicConnectivity.Arc arc, TreeDynamicConnectivity.Arc newArc)
Inserts thenewArc
in the arc list after thearc
(package private) void
addArcLast(TreeDynamicConnectivity.Arc arc)
Append thearc
to the arc list(package private) TreeDynamicConnectivity.Arc
getArcTo(TreeDynamicConnectivity.Node node)
Returns an arc, which target is equal to thenode
(package private) TreeDynamicConnectivity.Arc
getNextArc(TreeDynamicConnectivity.Arc arc)
Returns an arc which is stored right after thearc
.boolean
isSingleton()
Checks if this node is a zero-degree node(package private) void
removeArc(TreeDynamicConnectivity.Arc arc)
Removes thearc
from the arc listjava.lang.String
toString()
-
-
-
Field Detail
-
value
T value
Node value
-
arcs
DoublyLinkedList<TreeDynamicConnectivity.Arc> arcs
Arcs list
-
targetMap
java.util.Map<TreeDynamicConnectivity.Node,TreeDynamicConnectivity.Arc> targetMap
Target node to arc mapping
-
-
Constructor Detail
-
Node
public Node(T value)
Constructs a new node- Parameters:
value
- a user specified element to store in this node
-
-
Method Detail
-
removeArc
void removeArc(TreeDynamicConnectivity.Arc arc)
Removes thearc
from the arc list- Parameters:
arc
- an arc to remove
-
addArcLast
void addArcLast(TreeDynamicConnectivity.Arc arc)
Append thearc
to the arc list- Parameters:
arc
- an arc to add
-
addArcAfter
void addArcAfter(TreeDynamicConnectivity.Arc arc, TreeDynamicConnectivity.Arc newArc)
Inserts thenewArc
in the arc list after thearc
- Parameters:
arc
- an arc already stored in the arc listnewArc
- a new arc to add to the arc list
-
getArcTo
TreeDynamicConnectivity.Arc getArcTo(TreeDynamicConnectivity.Node node)
Returns an arc, which target is equal to thenode
- Parameters:
node
- a target of the returned arc- Returns:
- an arc, which target is equal to the
node
-
getNextArc
TreeDynamicConnectivity.Arc getNextArc(TreeDynamicConnectivity.Arc arc)
Returns an arc which is stored right after thearc
. The result may be equal to thearc
- Parameters:
arc
- an arc stored in the arc list- Returns:
- an arc which is stored right after the
arc
-
isSingleton
public boolean isSingleton()
Checks if this node is a zero-degree node- Returns:
true
if this node is a singleton node,false otherwise
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-