Package alluxio.collections
Class DirectedAcyclicGraphNode<T>
- java.lang.Object
-
- alluxio.collections.DirectedAcyclicGraphNode<T>
-
- Type Parameters:
T
- payload
@NotThreadSafe public class DirectedAcyclicGraphNode<T> extends java.lang.Object
A Directed Acyclic Graph (DAG) node.
-
-
Constructor Summary
Constructors Constructor Description DirectedAcyclicGraphNode(T payload)
A Directed Acyclic Graph (DAG) node.DirectedAcyclicGraphNode(T payload, java.util.List<DirectedAcyclicGraphNode<T>> parents, java.util.List<DirectedAcyclicGraphNode<T>> children)
A Directed Acyclic Graph (DAG) node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.java.util.List<DirectedAcyclicGraphNode<T>>
getChildren()
Gets the children nodes of the node.java.util.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.
-
-
-
Constructor Detail
-
DirectedAcyclicGraphNode
public DirectedAcyclicGraphNode(T payload, java.util.List<DirectedAcyclicGraphNode<T>> parents, java.util.List<DirectedAcyclicGraphNode<T>> children)
A Directed Acyclic Graph (DAG) node.- Parameters:
payload
- the payload of the nodeparents
- the parents of the nodechildren
- the children of the node
-
DirectedAcyclicGraphNode
public DirectedAcyclicGraphNode(T payload)
A Directed Acyclic Graph (DAG) node.- Parameters:
payload
- the payload of the node
-
-
Method Detail
-
getPayload
public T getPayload()
Gets the payload of the node.- Returns:
- the payload of the node
-
getParents
public java.util.List<DirectedAcyclicGraphNode<T>> getParents()
Gets the parent nodes of the node.- Returns:
- the parents of the node
-
getChildren
public java.util.List<DirectedAcyclicGraphNode<T>> getChildren()
Gets the children nodes of the node.- Returns:
- the children of the node
-
addParent
public void addParent(DirectedAcyclicGraphNode<T> parent)
Adds a parent node to the node.- Parameters:
parent
- the node to be added as a parent
-
addChild
public void addChild(DirectedAcyclicGraphNode<T> child)
Adds a child node to the node.- Parameters:
child
- the node to be added as a child
-
removeChild
public void removeChild(DirectedAcyclicGraphNode<T> child)
Removes a child node from the node.- Parameters:
child
- the child node to be removed
-
-