Package org.jppf.node.protocol.graph
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 Summary
ConstructorsConstructorDescriptionNode(int position, boolean done, List<TaskGraph.Node> dependencies) Initialize this node with the specified task. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDependency(TaskGraph.Node dependency) Add the specified dependency.booleanintReturns the position of this element in its container.inthashCode()booleanisDone()voidsetDone(boolean done) Shether this task is done, that is, either completed or cancelled.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.node.protocol.PositionalElement
setPosition
-
Constructor Details
-
Node
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 benull.
-
-
Method Details
-
addDependency
Add the specified dependency.- Parameters:
dependency- the dependency to add.
-
getDependencies
- Returns:
- the tasks that depend on this task, if any.
-
getPosition
public int getPosition()Description copied from interface:PositionalElementReturns the position of this element in its container.- Specified by:
getPositionin interfacePositionalElement<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
-
hashCode
public int hashCode() -
equals
-