Partilhar via


Node<DataT,NodeT> Class

  • java.lang.Object
    • com.azure.resourcemanager.resources.fluentcore.dag.Node<DataT,NodeT>

Type Parameters

DataT

the type of the data stored in the node

NodeT

the type of the node

public class Node<DataT,NodeT>

Type represents a node in a Graph<DataT,NodeT>.

Constructor Summary

Constructor Description
Node(String key, DataT data)

Creates a graph node.

Method Summary

Modifier and Type Method and Description
void addChild(String childKey)

Adds child (neighbour) to this node.

List<String> children()

Gets children (neighbours) of this node.

DataT data()

Gets data stored in this node.

boolean hasChildren()

Check whether the node has any children.

String key()

Gets this node's unique id.

Graph<DataT,NodeT> owner()

Gets the owner (container) graph of this node.

void removeChild(String childKey)

Removes child (neighbour) from this node.

void setOwner(Graph<DataT,NodeT> ownerGraph)

Sets reference to the graph owning this node.

Methods inherited from java.lang.Object

Constructor Details

Node

public Node(String key, DataT data)

Creates a graph node.

Parameters:

key - unique id of the node
data - data to be stored in the node

Method Details

addChild

public void addChild(String childKey)

Adds child (neighbour) to this node.

Parameters:

childKey - add a child (neighbour) of this node

children

public List<String> children()

Gets children (neighbours) of this node.

Returns:

children (neighbours) of this node

data

public DataT 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

key

public String key()

Gets this node's unique id.

Returns:

this node's unique id

owner

public Graph<DataT,NodeT> owner()

Gets the owner (container) graph of this node.

Returns:

the owner (container) graph of this node.

removeChild

public void removeChild(String childKey)

Removes child (neighbour) from this node.

Parameters:

childKey - remove child (neighbour) of this node

setOwner

public void setOwner(Graph<DataT,NodeT> ownerGraph)

Sets reference to the graph owning this node.

Parameters:

ownerGraph - the owning graph

Applies to