Class TaskGraph.Node

java.lang.Object
org.jppf.node.protocol.graph.TaskGraph.Node
All Implemented Interfaces:
Serializable, PositionalElement<TaskGraph.Node>
Enclosing class:
TaskGraph

public static class TaskGraph.Node extends Object implements Serializable, PositionalElement<TaskGraph.Node>
A node in the graph of the tasks in a job which represents a task and its dependants.
See Also:
  • Constructor Details

    • Node

      public Node(int position, boolean done, List<TaskGraph.Node> dependencies)
      Initialize this node with the specified task.
      Parameters:
      position - the position of this task.
      done - whether this task is done.
      dependencies - the dependencies of this task, may be null.
  • Method Details

    • addDependency

      public void addDependency(TaskGraph.Node dependency)
      Add the specified dependency.
      Parameters:
      dependency - the dependency to add.
    • getDependencies

      public List<TaskGraph.Node> getDependencies()
      Returns:
      the tasks that depend on this task, if any.
    • getPosition

      public int getPosition()
      Description copied from interface: PositionalElement
      Returns the position of this element in its container.
      Specified by:
      getPosition in interface PositionalElement<TaskGraph.Node>
      Returns:
      the position of this element as an int.
    • isDone

      public boolean isDone()
      Returns:
      whether this taks is done.
    • setDone

      public void setDone(boolean done)
      Shether this task is done, that is, either completed or cancelled.
      Parameters:
      done - the done state.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object