gumbo.interact
Class AbstractInteractorState

java.lang.Object
  |
  +--gumbo.util.state.AbstractStateSet
        |
        +--gumbo.interact.AbstractInteractorState
All Implemented Interfaces:
java.util.Collection, InteractorState, java.util.Set, StateSet

public class AbstractInteractorState
extends AbstractStateSet
implements InteractorState

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

Constructor Summary
AbstractInteractorState()
          Creates an instance, with a default InteractorPolicy.
AbstractInteractorState(java.util.Collection init)
          Creates an instance, with a default InteractorPolicy and an initial state, as allowed by the policy.
AbstractInteractorState(java.util.Collection init, StatePolicy policy)
          Creates an instance, with a state policy and an initial state, as allowed by the policy.
 
Method Summary
 InteractorState getInteractorState()
          Gets a singleton immutable view of this state, which is the current state value, resulting from the last reset or transit.
 StateSetField.EventIn getStateChangeIn()
          Calls change() with the received state flags (a "masked change").
 CollectionField.EventIn getStateResetIn()
          Calls reset() with the received state flags.
 StateSetField.EventOut getStateResetOut()
          Sends an immutable view of this state set when the state resets, whether or not the state value changed.
 CollectionField.EventIn getStateSetIn()
          Calls set() with the received state flags.
 StateSetField.EventOut getStateTransitOut()
          Sends an immutable view of this state set when the state transits (as a result of set(), change(), transit()), whether or not the state value changed.
protected  void stateReset()
          Default implementation: Sends a reset out event.
protected  void stateTransit()
          Default implementation: Sends a transit out event.
 
Methods inherited from class gumbo.util.state.AbstractStateSet
add, addAll, change, change, changeAll, clear, contains, containsAll, equals, getOldState, getStatePolicy, getStateSet, hashCode, isEmpty, iterator, remove, removeAll, reset, retainAll, set, size, toArray, toArray, toString, transit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gumbo.util.state.StateSet
change, change, changeAll, getOldState, getStatePolicy, getStateSet, reset, set, transit
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

AbstractInteractorState

public AbstractInteractorState()
Creates an instance, with a default InteractorPolicy. The initial state will be empty unless the policy dictates otherwise.


AbstractInteractorState

public AbstractInteractorState(java.util.Collection init)
Creates an instance, with a default InteractorPolicy and an initial state, as allowed by the policy.

Parameters:
init - The initial state (Object). None if null (initial state will be empty unless the policy dictates otherwise).

AbstractInteractorState

public AbstractInteractorState(java.util.Collection init,
                               StatePolicy policy)
Creates an instance, with a state policy and an initial state, as allowed by the policy. Master constructor.

Parameters:
init - The initial state (Object). None if null (initial state will be empty unless the policy dictates otherwise).
policy - The state policy. None if null. Typically, InteractorPolicy or a subclass.
Method Detail

stateReset

protected void stateReset()
Default implementation: Sends a reset out event.

Overrides:
stateReset in class AbstractStateSet

stateTransit

protected void stateTransit()
Default implementation: Sends a transit out event.

Overrides:
stateTransit in class AbstractStateSet

getStateResetIn

public CollectionField.EventIn getStateResetIn()
Description copied from interface: InteractorState
Calls reset() with the received state flags.

Specified by:
getStateResetIn in interface InteractorState

getStateSetIn

public CollectionField.EventIn getStateSetIn()
Description copied from interface: InteractorState
Calls set() with the received state flags.

Specified by:
getStateSetIn in interface InteractorState

getStateChangeIn

public StateSetField.EventIn getStateChangeIn()
Description copied from interface: InteractorState
Calls change() with the received state flags (a "masked change").

Specified by:
getStateChangeIn in interface InteractorState

getStateResetOut

public StateSetField.EventOut getStateResetOut()
Description copied from interface: InteractorState
Sends an immutable view of this state set when the state resets, whether or not the state value changed. Sent just after stateReset() is called.

Specified by:
getStateResetOut in interface InteractorState

getStateTransitOut

public StateSetField.EventOut getStateTransitOut()
Description copied from interface: InteractorState
Sends an immutable view of this state set when the state transits (as a result of set(), change(), transit()), whether or not the state value changed. Sent just after stateTransit() is called.

Specified by:
getStateTransitOut in interface InteractorState

getInteractorState

public InteractorState getInteractorState()
Description copied from interface: InteractorState
Gets a singleton immutable view of this state, which is the current state value, resulting from the last reset or transit.

Specified by:
getInteractorState in interface InteractorState
Returns:
The view (Object). Never null.