gumbo.util.state
Class AbsoluteStateMerger

java.lang.Object
  |
  +--gumbo.util.state.StateMerger
        |
        +--gumbo.util.state.AbsoluteStateMerger

public class AbsoluteStateMerger
extends StateMerger

A state merger that updates the output state according to the current value of all its input states, which is effectively an or'ing of the input state flags. A state merger that updates the output state according to the value of all its input states. As such, recognizes absolute values, not value changes, and considers all inputs, not just the one received. Note that an internal copy of the input states is NOT maintained.

Version:
$Revision: 1.1 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Constructor Summary
AbsoluteStateMerger()
          Creates an instance, with no output state policy and onChange filtering.
AbsoluteStateMerger(StateSet target, boolean onChange)
          Creates an instance.
 
Method Summary
 BooleanField.EventIn getActiveIn()
          While false, input events are ignored.
protected  boolean implActiveIn()
          Called by the system when activation is changed.
protected  boolean implIn(StateSet in)
          Called by the system when an input state is received and isOnChange() is satisfied (new and old state different).
protected  void implSyncIn()
          Called by the system when a sync input is received.
 
Methods inherited from class gumbo.util.state.StateMerger
getInputs, getOut, getSyncIn, getTargetState, isOnChange, newIn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsoluteStateMerger

public AbsoluteStateMerger()
Creates an instance, with no output state policy and onChange filtering.


AbsoluteStateMerger

public AbsoluteStateMerger(StateSet target,
                           boolean onChange)
Creates an instance.

Parameters:
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, output events are sent only if the data value changes.
Method Detail

getActiveIn

public BooleanField.EventIn getActiveIn()
While false, input events are ignored. Defaults to true. While inactive and inputs are no longer being tracked the internal state must be assumed invalid. As such, when going active the internal state is reset to that of all its inputs.

Overrides:
getActiveIn in class StateMerger

implIn

protected boolean implIn(StateSet in)
Description copied from class: StateMerger
Called by the system when an input state is received and isOnChange() is satisfied (new and old state different). Implementors should update the internal target state as needed. The system will generate an output event if warranted.

Specified by:
implIn in class StateMerger
Parameters:
in - The input state. Never null.
Returns:
True if the target state was set, whether or not it changed, and an output event may be warranted.

implActiveIn

protected boolean implActiveIn()
Description copied from class: StateMerger
Called by the system when activation is changed. Implementors should update the internal target state as needed. The system will generate an output event if warranted.

Specified by:
implActiveIn in class StateMerger
Returns:
True if the target state was set, whether or not it changed, and an output event may be warranted.

implSyncIn

protected void implSyncIn()
Description copied from class: StateMerger
Called by the system when a sync input is received. Implementors should update the internal target state as needed. The system will always generate an output event.

Specified by:
implSyncIn in class StateMerger