Class DirectedAcyclicGraphNode<T>

  • Type Parameters:
    T - payload

    @NotThreadSafe
    public class DirectedAcyclicGraphNode<T>
    extends java.lang.Object
    A Directed Acyclic Graph (DAG) 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 node
        parents - the parents of the node
        children - 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