Class Node<DataT,NodeT extends Node<DataT,NodeT>>
java.lang.Object
com.azure.resourcemanager.resources.fluentcore.dag.Node<DataT,NodeT>
- Type Parameters:
DataT- the type of the data stored in the nodeNodeT- the type of the node
- Direct Known Subclasses:
DAGNode
Type represents a node in a
Graph.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds child (neighbour) to this node.children()Gets children (neighbours) of this node.data()Gets data stored in this node.booleanCheck whether the node has any children.key()Gets this node's unique id.owner()Gets the owner (container) graph of this node.voidremoveChild(String childKey) Removes child (neighbour) from this node.voidSets reference to the graph owning this node.
-
Constructor Details
-
Node
Creates a graph node.- Parameters:
key- unique id of the nodedata- data to be stored in the node
-
-
Method Details
-
key
Gets this node's unique id.- Returns:
- this node's unique id
-
data
Gets data stored in this node.- Returns:
- data stored in this node
-
hasChildren
public boolean hasChildren()Check whether the node has any children.- Returns:
- true if this node has any children
-
children
Gets children (neighbours) of this node.- Returns:
- children (neighbours) of this node
-
addChild
Adds child (neighbour) to this node.- Parameters:
childKey- add a child (neighbour) of this node
-
removeChild
Removes child (neighbour) from this node.- Parameters:
childKey- remove child (neighbour) of this node
-
setOwner
Sets reference to the graph owning this node.- Parameters:
ownerGraph- the owning graph
-
owner
Gets the owner (container) graph of this node.- Returns:
- the owner (container) graph of this node.
-