public abstract class ObserverAdapter extends Observer
Modifier and Type | Field and Description |
---|---|
private static boolean |
DEBUG |
awakeningThread, DIRECTLY_OBSERVED, lastQueryResultOnDirectlyObserved, myKBase, observedFormulas, timeout, timeoutDisabled, updatedOnce, wakeUpDate
Constructor and Description |
---|
ObserverAdapter(KBase kbase,
Formula formula)
Creates a new Observer
|
ObserverAdapter(KBase kbase,
Formula formula,
Date wakeupdate)
Creates a new Observer
|
ObserverAdapter(KBase kbase,
Formula formula,
long timeout)
Creates a new Observer with timeout
|
Modifier and Type | Method and Description |
---|---|
abstract void |
action(QueryResult value)
Should be overridden.
|
Formula |
getObservedFormula() |
boolean |
update(Formula formula)
This method is called to update the observer according to
the change that has just occurred on the given formula.
|
addFormula, disableTimeout, getMyKBase, getObservedFormulas, getTimeOut, getWakeUpDate, isEnabledTimeout, timeout, toString
private static final boolean DEBUG
public ObserverAdapter(KBase kbase, Formula formula)
formula
- the formula to observepublic ObserverAdapter(KBase kbase, Formula formula, long timeout)
formula
- the formula to observetimeout
- the (Long) value of the delay before stopping to observe the formulapublic Formula getObservedFormula()
public abstract void action(QueryResult value)
value
- is the last value queried of the observed formula.public boolean update(Formula formula)
Observer