|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object frysk.proc.Observation frysk.proc.live.TaskObservation
public abstract class TaskObservation
The binding between an Observer and its Observable.
Field Summary | |
---|---|
private Runnable |
action
|
private boolean |
adding
|
private LiveTask |
task
|
Fields inherited from class frysk.proc.Observation |
---|
observable, observer |
Constructor Summary | |
---|---|
TaskObservation(LiveTask task,
TaskObservable observable,
TaskObserver observer,
boolean adding)
|
|
TaskObservation(LiveTask task,
TaskObservable observable,
TaskObserver observer,
Runnable action,
boolean adding)
Create a new Observer binding. |
Method Summary | |
---|---|
void |
add()
Runs any action (if suplied) and then adds the observer to the observable. |
void |
delete()
Deletes the observer from the observable and then runs any action (if suplied). |
TaskObservable |
getTaskObservable()
|
TaskObserver |
getTaskObserver()
|
void |
handleAdd()
Handle adding the Observer to the Observable. |
void |
handleDelete()
Handle deleting the Observer from the Observable. |
boolean |
isAddition()
Returns true if this is an addition, false if it is a deletion. |
boolean |
needsSuspendedAction()
Returns true if an action was supplied to the constructor to be run when the Task is (temporarily) suspended. |
Methods inherited from class frysk.proc.Observation |
---|
equals, fail, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface frysk.event.Event |
---|
execute |
Field Detail |
---|
private final LiveTask task
private final Runnable action
private final boolean adding
Constructor Detail |
---|
public TaskObservation(LiveTask task, TaskObservable observable, TaskObserver observer, boolean adding)
public TaskObservation(LiveTask task, TaskObservable observable, TaskObserver observer, Runnable action, boolean adding)
task
- The Task the observer will be added to.observable
- The TaskObservable (of the specified task)
that the observer should be added to.observer
- The TaskObserver to add.action
- An action to run, or null if none, before adding
or after deletion while the Task is (temporarily) suspended.Method Detail |
---|
public void handleAdd()
add()
when it is actually
ready to bind the observer to the observable.
handleAdd
in class Observation
needsSuspendedAction()
public void handleDelete()
delete()
when it is actually
ready to bind the observer to the observable.
handleDelete
in class Observation
needsSuspendedAction()
public TaskObservable getTaskObservable()
public TaskObserver getTaskObserver()
public boolean isAddition()
public boolean needsSuspendedAction()
add()
or delete()
on this
TaskObservation.
public void add()
needsSuspendedAction()
returns true
then this method should only be called if the Task is
(temporarily) suspended.
public void delete()
needsSuspendedAction()
returns true then this method should only be called if the Task
is (temporarily) suspended.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |