Package org.jppf.node.protocol.graph
Class JobDependencyGraphImpl
java.lang.Object
org.jppf.node.protocol.graph.JobDependencyGraphImpl
- All Implemented Interfaces:
Serializable,JobDependencyGraph
- Direct Known Subclasses:
MutableJobDependencyGraph
A representation of the jobs dependencies graph. This is a directed acyclic graph.
- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Construct this graph from an existing collection of nodes. -
Method Summary
Modifier and TypeMethodDescriptionGet the ids of all the nodes currently in this graph.getDependedOn(String id) Get the nodes that depend on the node with the specified dependency id.Get the node for the specified dependency id.getNodeByJobUuid(String jobUuid) Get the node whose corresponding job has the specified uuid.Get the dependency ids of all the nodes currently in this graph.Get the nodes in the job dependency graph, whose corresponding job has arrived in the job queue.intgetSize()Get the size of this graph, that is, the number of nodes or vertices.booleanisEmpty()Determine whether this job dependency graph is empy.
-
Constructor Details
-
JobDependencyGraphImpl
public JobDependencyGraphImpl()Default constructor. -
JobDependencyGraphImpl
Construct this graph from an existing collection of nodes.- Parameters:
nodes- the nodes constituting the graph.
-
-
Method Details
-
getNode
Description copied from interface:JobDependencyGraphGet the node for the specified dependency id.- Specified by:
getNodein interfaceJobDependencyGraph- Parameters:
id- the id of the node to retrieve.- Returns:
- a
JobDependencyNodeinstance, ornullif no node has the specified id.
-
getSize
public int getSize()Description copied from interface:JobDependencyGraphGet the size of this graph, that is, the number of nodes or vertices.- Specified by:
getSizein interfaceJobDependencyGraph- Returns:
- the size of this graph, always >= 0.
-
getNodeIds
Description copied from interface:JobDependencyGraphGet the dependency ids of all the nodes currently in this graph.- Specified by:
getNodeIdsin interfaceJobDependencyGraph- Returns:
- a Set of nodes ids, possibly empty.
-
getNodeByJobUuid
Description copied from interface:JobDependencyGraphGet the node whose corresponding job has the specified uuid.- Specified by:
getNodeByJobUuidin interfaceJobDependencyGraph- Parameters:
jobUuid- the id of job associated with the node to retrieve.- Returns:
- a
JobDependencyNodeinstance, ornullif no node as the specified job uuid.
-
getAllNodes
Description copied from interface:JobDependencyGraphGet the ids of all the nodes currently in this graph.- Specified by:
getAllNodesin interfaceJobDependencyGraph- Returns:
- a Set of nodes ids, possibly empty.
-
getQueuedNodes
Description copied from interface:JobDependencyGraphGet the nodes in the job dependency graph, whose corresponding job has arrived in the job queue.- Specified by:
getQueuedNodesin interfaceJobDependencyGraph- Returns:
- a Set of nodes ids, possibly empty.
-
getDependedOn
Description copied from interface:JobDependencyGraphGet the nodes that depend on the node with the specified dependency id.- Specified by:
getDependedOnin interfaceJobDependencyGraph- Parameters:
id- the id of the node whose dependents to find.- Returns:
- a collection of nodes that dependen on the specified node, or
nullif there is no node with the specified id.
-
isEmpty
public boolean isEmpty()Description copied from interface:JobDependencyGraphDetermine whether this job dependency graph is empy.- Specified by:
isEmptyin interfaceJobDependencyGraph- Returns:
trueif this graph is empty,falseotherwise.
-