|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.util.state.AbstractStateTrigger
An abstract base class for a trigger that fires when a state update condition is satisfied. To implement a concrete trigger, provide a means for establishing and testing the trigger conditions, and for notifying event listeners when the trigger has fired.
Typically, triggers can be level or edge sensing. Level triggers can fire on high (flags set) or low (flags not set) conditions; whereas, edge triggers can fire on rising (flags added), falling (flags removed), or changing (flags changed) conditions.
Todo: Finish replacing methods with event fields.
Constructor Summary | |
AbstractStateTrigger()
Deprecated. Constructs an instance, that is multi-shot and enabled. |
|
AbstractStateTrigger(boolean multiShot,
boolean enable)
Deprecated. Constructs an instance, as specified. |
Method Summary | |
boolean |
getMultiShotMode()
Deprecated. Gets whether or not multi-shot mode is enabled. |
StateSetField.EventIn |
getStateResetIn()
Deprecated. Receives an event when a source state set resets, whether or not the state value changed. |
StateSetField.EventIn |
getStateTransitIn()
Deprecated. Receives an event when a source state set transits, whether or not the state value changed. |
boolean |
getTriggerEnable()
Deprecated. Gets whether or not this trigger is enabled for firing. |
boolean |
hasTriggerFired()
Deprecated. Gets this trigger's firing state. |
protected abstract void |
notifyTriggerFired()
Deprecated. Called by the system each time this trigger fires, in which case the trigger listeners should be notified accordingly. |
protected abstract void |
notifyTriggerReset()
Deprecated. Called by the system when this trigger had fired and is reset, in which case the trigger listeners should be notified accordingly. |
void |
resetTriggerFired()
Deprecated. Resets this trigger's firing state, even if the trigger is disabled. |
void |
setMultiShotMode(boolean multiShot)
Deprecated. Sets whether or not multi-shot mode is enabled. |
void |
setTriggerEnable(boolean enable)
Deprecated. Sets whether or not this trigger is enabled for firing. |
protected abstract boolean |
testTriggerCondition(java.util.Set newState,
java.util.Set oldState)
Deprecated. Called by the system when a monitored state value has been updated (whether or not it has changed) and the trigger condition needs to be tested. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractStateTrigger()
public AbstractStateTrigger(boolean multiShot, boolean enable)
multiShot
- If true, the trigger mode is multi-shot (see
setMultiShotMode()).enable
- If true, the trigger is immediately enabled.Method Detail |
public StateSetField.EventIn getStateResetIn()
public StateSetField.EventIn getStateTransitIn()
public void setMultiShotMode(boolean multiShot)
multiShot
- If true, this trigger will fire each time the
trigger condition is satisfied; otherwise, the trigger has
to be reset after each firing in order to fire again.public boolean getMultiShotMode()
public void setTriggerEnable(boolean enable)
enable
- If true, this trigger is reset and then
enabled/re-enabled for firing; otherwise, the trigger is
disabled from firing.public boolean getTriggerEnable()
public void resetTriggerFired()
public boolean hasTriggerFired()
protected abstract boolean testTriggerCondition(java.util.Set newState, java.util.Set oldState)
newState
- The new state value. Never null.oldState
- The old state value. Null if not available.
protected abstract void notifyTriggerFired()
protected abstract void notifyTriggerReset()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |