T
- payload@NotThreadSafe public class DirectedAcyclicGraphNode<T> extends Object
Constructor and Description |
---|
DirectedAcyclicGraphNode(T payload)
A Directed Acyclic Graph (DAG) node.
|
DirectedAcyclicGraphNode(T payload,
List<DirectedAcyclicGraphNode<T>> parents,
List<DirectedAcyclicGraphNode<T>> children)
A Directed Acyclic Graph (DAG) node.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(DirectedAcyclicGraphNode<T> child)
Adds a child node to the node.
|
void |
addParent(DirectedAcyclicGraphNode<T> parent)
Adds a parent node to the node.
|
List<DirectedAcyclicGraphNode<T>> |
getChildren()
Gets the children nodes of the node.
|
List<DirectedAcyclicGraphNode<T>> |
getParents()
Gets the parent nodes of the node.
|
T |
getPayload()
Gets the payload of the node.
|
void |
removeChild(DirectedAcyclicGraphNode<T> child)
Removes a child node from the node.
|
public DirectedAcyclicGraphNode(T payload, List<DirectedAcyclicGraphNode<T>> parents, List<DirectedAcyclicGraphNode<T>> children)
payload
- the payload of the nodeparents
- the parents of the nodechildren
- the children of the nodepublic DirectedAcyclicGraphNode(T payload)
payload
- the payload of the nodepublic T getPayload()
public List<DirectedAcyclicGraphNode<T>> getParents()
public List<DirectedAcyclicGraphNode<T>> getChildren()
public void addParent(DirectedAcyclicGraphNode<T> parent)
parent
- the node to be added as a parentpublic void addChild(DirectedAcyclicGraphNode<T> child)
child
- the node to be added as a childpublic void removeChild(DirectedAcyclicGraphNode<T> child)
child
- the child node to be removedCopyright © 2023. All Rights Reserved.