org.globus.cog.abstraction.interfaces
Interface Dependency

All Known Implementing Classes:
DependencyImpl

public interface Dependency

This interface provides the control dependencies between various ExecutableObjects.

Dependencies are specified as ("from","to") pairs, indicating that the ExecutableObject representing "from" will be executed before that representing "to".


Field Summary
static int GRAPH
          Represents a grpah-like dependency.
static int NONE
          Represents no dependencies at all.
static int QUEUE
          Represents a queue-like dependency (Also refered to as FIFO dependency).
static int TREE
          Represent a tree-like dependency.
 
Method Summary
 void add(ExecutableObject from, ExecutableObject to)
          Adds the dependency between the "from" ExecutableObject and "to" ExecutableObject.
 boolean contains(ExecutableObject from, ExecutableObject to)
          Specifies if this Dependency object contains a dependency between the given ExecutableObjects.
 Enumeration elements()
          Returns all the DependencyPair encapsulated within this Dependency object.
 Enumeration getDependents(ExecutableObject executableObject)
          Returns all the ExecutableObject s that depend on the given ExecutableObject.
 Enumeration getDependsOn(ExecutableObject executableObject)
          Returns all the ExecutableObject s on which the given ExecutableObject is dependent.
 int getType()
          Returns the type of dependency pattern represented by this Dependency object.
 boolean hasDependents(ExecutableObject executableObject)
          Specifies if the given ExecutableObject has any dependent (children).
 boolean isDependent(ExecutableObject executableObject)
          Specifies if the given ExecutableObject is a dependent (child) of any other ExecutableObject.
 boolean remove(ExecutableObject from, ExecutableObject to)
          Removes the dependency between the "from" ExecutableObject and "to" ExecutableObject.
 boolean removeAllDependents(ExecutableObject id)
          Removes all dependencies that has the given ExecutableObject as the parent.
 boolean removeAllDependsOn(ExecutableObject executableObject)
          Removes all dependencies that has the given ExecutableObject as the child.
 void setType(int type)
          Sets the type of dependency pattern represented by this Dependency object.
 int size()
          Returns the total number of dependencies.
 

Field Detail

NONE

public static final int NONE
Represents no dependencies at all. Valid for Set

See Also:
Constant Field Values

QUEUE

public static final int QUEUE
Represents a queue-like dependency (Also refered to as FIFO dependency). Valid for Queue

See Also:
Constant Field Values

GRAPH

public static final int GRAPH
Represents a grpah-like dependency. Valid for all classes of TaskGraph

See Also:
Constant Field Values

TREE

public static final int TREE
Represent a tree-like dependency. Not yet implemented

See Also:
Constant Field Values
Method Detail

setType

public void setType(int type)
Sets the type of dependency pattern represented by this Dependency object.


getType

public int getType()
Returns the type of dependency pattern represented by this Dependency object.


elements

public Enumeration elements()
Returns all the DependencyPair encapsulated within this Dependency object.

Returns:
an enumeration of DependencyPair objects

getDependents

public Enumeration getDependents(ExecutableObject executableObject)
Returns all the ExecutableObject s that depend on the given ExecutableObject.

Parameters:
executableObject - the ExecutableObject representing the parent.
Returns:
an enumeration of ExecutableObjectobjects

getDependsOn

public Enumeration getDependsOn(ExecutableObject executableObject)
Returns all the ExecutableObject s on which the given ExecutableObject is dependent.

Parameters:
executableObject - the ExecutableObject representing the dependent ExecutableObject.
Returns:
an enumeration of ExecutableObjectobjects

add

public void add(ExecutableObject from,
                ExecutableObject to)
Adds the dependency between the "from" ExecutableObject and "to" ExecutableObject.

Parameters:
from - the parent ExecutableObject.
to - the child ExecutableObject.

remove

public boolean remove(ExecutableObject from,
                      ExecutableObject to)
Removes the dependency between the "from" ExecutableObject and "to" ExecutableObject.

Parameters:
from - the parent ExecutableObject.
to - the child ExecutableObject.

removeAllDependents

public boolean removeAllDependents(ExecutableObject id)
Removes all dependencies that has the given ExecutableObject as the parent.

Parameters:
id - the parent ExecutableObject
Returns:
true if all the dependencies are removed. false otherwise.

removeAllDependsOn

public boolean removeAllDependsOn(ExecutableObject executableObject)
Removes all dependencies that has the given ExecutableObject as the child.

Returns:
true if all the dependencies are removed. false otherwise.

hasDependents

public boolean hasDependents(ExecutableObject executableObject)
Specifies if the given ExecutableObject has any dependent (children).

Parameters:
executableObject - the parent ExecutableObject
Returns:
true if the given ExecutableObject has dependents. false otherwise.

isDependent

public boolean isDependent(ExecutableObject executableObject)
Specifies if the given ExecutableObject is a dependent (child) of any other ExecutableObject.

Parameters:
executableObject - the child ExecutableObject
Returns:
true if the given ExecutableObject is a child in some dependency. false otherwise.

contains

public boolean contains(ExecutableObject from,
                        ExecutableObject to)
Specifies if this Dependency object contains a dependency between the given ExecutableObjects.

Parameters:
from - the parent ExecutableObject
to - the child ExecutableObject
Returns:
true if there exists a dependency between the given ExecutableObjects.false otherwise.

size

public int size()
Returns the total number of dependencies.