org.schmant.run
Class AlreadySatisfiedTaskDependency

java.lang.Object
  extended by java.util.Observable
      extended by org.schmant.run.AlreadySatisfiedTaskDependency
All Implemented Interfaces:
TaskDependency

public class AlreadySatisfiedTaskDependency
extends Observable
implements TaskDependency

This task dependency is already satisfied! It can be used when scheduling a task that might have had but did not have dependencies.

Since:
0.8
Author:
Karl Gustafsson

Field Summary
static AlreadySatisfiedTaskDependency INSTANCE
          This singleton instance may be used instead of instantiating this class.
 
Constructor Summary
AlreadySatisfiedTaskDependency()
           
 
Method Summary
 Observable getDependencyObservable()
          Get an observable for this dependency.
 Lock getSatisfiedStateLock()
          This method returns a dummy lock.
 boolean isSatisfied()
          This method always returns true.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final AlreadySatisfiedTaskDependency INSTANCE
This singleton instance may be used instead of instantiating this class.

Constructor Detail

AlreadySatisfiedTaskDependency

public AlreadySatisfiedTaskDependency()
Method Detail

getDependencyObservable

public Observable getDependencyObservable()
Get an observable for this dependency. Note that this observable will never notify its observers since this dependency is already satisfied.

Specified by:
getDependencyObservable in interface TaskDependency
Returns:
An Observable to observe.

getSatisfiedStateLock

public Lock getSatisfiedStateLock()
This method returns a dummy lock.

Specified by:
getSatisfiedStateLock in interface TaskDependency
Returns:
The lock used to protect the satisfied state.
See Also:
TaskDependency.isSatisfied()

isSatisfied

public boolean isSatisfied()
This method always returns true.

Specified by:
isSatisfied in interface TaskDependency
Returns:
true if the dependency is satisfied.