java.lang.Object
org.jgrapht.alg.connectivity.TreeDynamicConnectivity.Node
- Enclosing class:
TreeDynamicConnectivity<T>
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
FieldsModifier and TypeFieldDescription(package private) DoublyLinkedList<TreeDynamicConnectivity<T>.Arc> Arcs list(package private) Map<TreeDynamicConnectivity<T>.Node, TreeDynamicConnectivity<T>.Arc> Target node to arc mapping(package private) TNode value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddArcAfter(TreeDynamicConnectivity<T>.Arc arc, TreeDynamicConnectivity<T>.Arc newArc) Inserts thenewArcin the arc list after thearc(package private) voidAppend thearcto the arc list(package private) TreeDynamicConnectivity<T>.ArcgetArcTo(TreeDynamicConnectivity<T>.Node node) Returns an arc, which target is equal to thenode(package private) TreeDynamicConnectivity<T>.ArcReturns an arc which is stored right after thearc.booleanChecks if this node is a zero-degree node(package private) voidremoveArc(TreeDynamicConnectivity<T>.Arc arc) Removes thearcfrom the arc listtoString()
-
Field Details
-
value
T valueNode value -
arcs
Arcs list -
targetMap
Map<TreeDynamicConnectivity<T>.Node,TreeDynamicConnectivity<T>.Arc> targetMapTarget node to arc mapping
-
-
Constructor Details
-
Node
Constructs a new node- Parameters:
value- a user specified element to store in this node
-
-
Method Details
-
removeArc
Removes thearcfrom the arc list- Parameters:
arc- an arc to remove
-
addArcLast
Append thearcto the arc list- Parameters:
arc- an arc to add
-
addArcAfter
Inserts thenewArcin 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
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
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:
trueif this node is a singleton node,false otherwise
-
toString
-