|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.util.state.StateMerger
Base class for filters that merge (combine) input states into a single composite output state. Null inputs are ignored. The output is equivalent to a union if the state flags in each input are unique (masks do not overlap in state space).
Constructor Summary | |
StateMerger()
Creates an instance, with no output state policy and onChange filtering. |
|
StateMerger(StateSet target,
boolean onChange)
Creates an instance. |
Method Summary | |
BooleanField.EventIn |
getActiveIn()
While false, input events are ignored (except sync in). |
java.util.Set |
getInputs()
Gets an immutable view of this filter's event inputs (StateSetField.EventIn). |
StateSetField.EventOut |
getOut()
Gets this filter's event output. |
BooleanField.EventIn |
getSyncIn()
If true, updates the internal state from the current inputs and sends an output event, regardless of active in or isOnChange(). |
protected StateSet |
getTargetState()
Gets the internal target state. |
protected abstract boolean |
implActiveIn()
Called by the system when activation is changed. |
protected abstract boolean |
implIn(StateSet in)
Called by the system when an input state is received and isOnChange() is satisfied (new and old state different). |
protected abstract void |
implSyncIn()
Called by the system when a sync input is received. |
boolean |
isOnChange()
Returns true if the target state is updated and output only if an input changes its state. |
StateSetField.EventIn |
newIn()
Returns a new filter event input. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StateMerger()
public StateMerger(StateSet target, boolean onChange)
target
- The target state set used for output. Should have
a state policy consistent with inputs and outputs. If null, a
default one is used, with no policy.onChange
- If true, the target state is updated and output
only if an input changes its state.Method Detail |
public StateSetField.EventIn newIn()
public boolean isOnChange()
public java.util.Set getInputs()
public BooleanField.EventIn getActiveIn()
public BooleanField.EventIn getSyncIn()
public StateSetField.EventOut getOut()
protected StateSet getTargetState()
protected abstract boolean implIn(StateSet in)
in
- The input state. Never null.
protected abstract boolean implActiveIn()
protected abstract void implSyncIn()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |