|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable org.schmant.run.CompoundTaskDependency
public class CompoundTaskDependency
This object is used to bundle several TaskDependency
objects into
one.
Constructor Summary | |
---|---|
CompoundTaskDependency()
|
Method Summary | |
---|---|
CompoundTaskDependency |
add(TaskDependency td)
Add one task dependency. |
CompoundTaskDependency |
addAll(Collection<? extends TaskDependency> c)
Add several task dependencies. |
CompoundTaskDependency |
addAll(TaskDependency... tdArr)
Add several task dependencies. |
Observable |
getDependencyObservable()
Observable that will fire with the dependency as argument when all dependencies are satisfied. |
Lock |
getSatisfiedStateLock()
Get the Lock that protects the dependency's satisfied
property. |
boolean |
isSatisfied()
Is this dependency satisfied? |
String |
toString()
|
void |
update(Observable obs,
Object o)
|
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, wait, wait, wait |
Constructor Detail |
---|
public CompoundTaskDependency()
Method Detail |
---|
public CompoundTaskDependency add(TaskDependency td)
td
- The task dependency. This may not be null
.
this
public CompoundTaskDependency addAll(TaskDependency... tdArr)
tdArr
- The task dependencies to add. null
elements are
automatically discarded
this
public CompoundTaskDependency addAll(Collection<? extends TaskDependency> c)
c
- The task dependencies to add. null
elements are
automatically discarded.
this
public Observable getDependencyObservable()
TaskDependency
Implementation note: The thread firing an event must own the satisfied state lock on the task dependency object.
getDependencyObservable
in interface TaskDependency
Observable
to observe.public boolean isSatisfied()
TaskDependency
Implementation note: This method should be protected by the same
lock that can be retrieved by calling TaskDependency.getSatisfiedStateLock()
.
isSatisfied
in interface TaskDependency
true
if the dependency is satisfied.public Lock getSatisfiedStateLock()
TaskDependency
Lock
that protects the dependency's satisfied
property. This lock must be locked before the dependency's satisfied
state can be update.
An external class can lock this to ensure that the satisfied state is not updated while it holds the lock.
getSatisfiedStateLock
in interface TaskDependency
TaskDependency.isSatisfied()
public void update(Observable obs, Object o)
update
in interface Observer
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |