org.globus.cog.abstraction.impl.common.taskgraph
Class DependencyImpl

java.lang.Object
  extended byorg.globus.cog.abstraction.impl.common.taskgraph.DependencyImpl
All Implemented Interfaces:
Dependency

public class DependencyImpl
extends Object
implements Dependency


Field Summary
 
Fields inherited from interface org.globus.cog.abstraction.interfaces.Dependency
GRAPH, NONE, QUEUE, TREE
 
Constructor Summary
DependencyImpl()
           
DependencyImpl(int type)
           
 
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 executableObject)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyImpl

public DependencyImpl()

DependencyImpl

public DependencyImpl(int type)
Method Detail

setType

public void setType(int type)
Description copied from interface: Dependency
Sets the type of dependency pattern represented by this Dependency object.

Specified by:
setType in interface Dependency

getType

public int getType()
Description copied from interface: Dependency
Returns the type of dependency pattern represented by this Dependency object.

Specified by:
getType in interface Dependency

elements

public Enumeration elements()
Description copied from interface: Dependency
Returns all the DependencyPair encapsulated within this Dependency object.

Specified by:
elements in interface Dependency
Returns:
an enumeration of DependencyPair objects

getDependents

public Enumeration getDependents(ExecutableObject executableObject)
Description copied from interface: Dependency
Returns all the ExecutableObject s that depend on the given ExecutableObject.

Specified by:
getDependents in interface Dependency
Parameters:
executableObject - the ExecutableObject representing the parent.
Returns:
an enumeration of ExecutableObjectobjects

getDependsOn

public Enumeration getDependsOn(ExecutableObject executableObject)
Description copied from interface: Dependency
Returns all the ExecutableObject s on which the given ExecutableObject is dependent.

Specified by:
getDependsOn in interface Dependency
Parameters:
executableObject - the ExecutableObject representing the dependent ExecutableObject.
Returns:
an enumeration of ExecutableObjectobjects

add

public void add(ExecutableObject from,
                ExecutableObject to)
Description copied from interface: Dependency
Adds the dependency between the "from" ExecutableObject and "to" ExecutableObject.

Specified by:
add in interface Dependency
Parameters:
from - the parent ExecutableObject.
to - the child ExecutableObject.

remove

public boolean remove(ExecutableObject from,
                      ExecutableObject to)
Description copied from interface: Dependency
Removes the dependency between the "from" ExecutableObject and "to" ExecutableObject.

Specified by:
remove in interface Dependency
Parameters:
from - the parent ExecutableObject.
to - the child ExecutableObject.

removeAllDependents

public boolean removeAllDependents(ExecutableObject executableObject)
Description copied from interface: Dependency
Removes all dependencies that has the given ExecutableObject as the parent.

Specified by:
removeAllDependents in interface Dependency
Parameters:
executableObject - the parent ExecutableObject
Returns:
true if all the dependencies are removed. false otherwise.

removeAllDependsOn

public boolean removeAllDependsOn(ExecutableObject executableObject)
Description copied from interface: Dependency
Removes all dependencies that has the given ExecutableObject as the child.

Specified by:
removeAllDependsOn in interface Dependency
Returns:
true if all the dependencies are removed. false otherwise.

hasDependents

public boolean hasDependents(ExecutableObject executableObject)
Description copied from interface: Dependency
Specifies if the given ExecutableObject has any dependent (children).

Specified by:
hasDependents in interface Dependency
Parameters:
executableObject - the parent ExecutableObject
Returns:
true if the given ExecutableObject has dependents. false otherwise.

isDependent

public boolean isDependent(ExecutableObject executableObject)
Description copied from interface: Dependency
Specifies if the given ExecutableObject is a dependent (child) of any other ExecutableObject.

Specified by:
isDependent in interface Dependency
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)
Description copied from interface: Dependency
Specifies if this Dependency object contains a dependency between the given ExecutableObjects.

Specified by:
contains in interface Dependency
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()
Description copied from interface: Dependency
Returns the total number of dependencies.

Specified by:
size in interface Dependency