net.groboclown.util.states.v1
Class Stateful

java.lang.Object
  |
  +--net.groboclown.util.states.v1.Stateful

public class Stateful
extends Object

Version:
0.9.0 Alpha
Author:
Matt Albrecht

Field Summary
private  Object[] actions
           
private  StateCategory category
           
private  Object currentAction
           
private  int currentState
           
private  net.groboclown.util.states.v1.IStatefulListener listener
           
 
Constructor Summary
Stateful(net.groboclown.util.states.v1.IStatefulListener listener)
          Default Constructor
 
Method Summary
 void addStateAction(State s, Object action)
           
protected  void initialize(StateCategory s)
           
 void removeStateAction(State s)
           
 void setState(State s)
          Only calls the listener's setAction if the new state is different than the current state, and the new state's action object is different than the current action object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

listener

private net.groboclown.util.states.v1.IStatefulListener listener

category

private StateCategory category

actions

private Object[] actions

currentState

private int currentState

currentAction

private Object currentAction
Constructor Detail

Stateful

public Stateful(net.groboclown.util.states.v1.IStatefulListener listener)
Default Constructor
Method Detail

addStateAction

public void addStateAction(State s,
                           Object action)

removeStateAction

public void removeStateAction(State s)

setState

public void setState(State s)
Only calls the listener's setAction if the new state is different than the current state, and the new state's action object is different than the current action object.

initialize

protected void initialize(StateCategory s)


Written under the LGPL