net.openai.util.fsm
Class AbstractCondition

java.lang.Object
  extended by net.openai.util.fsm.AbstractCondition
All Implemented Interfaces:
java.io.Serializable, Condition
Direct Known Subclasses:
AnyCondition, BooleanCondition, ComparableCondition, EqualsCondition, NotCondition, NullCondition

public abstract class AbstractCondition
extends java.lang.Object
implements Condition

A simple base class for conditions.

See Also:
Serialized Form

Constructor Summary
AbstractCondition()
          Constructs a new AbstractCondition object.
AbstractCondition(State targetState)
          Constructs a new AbstractCondition with the given target state.
 
Method Summary
 State getTargetState()
          Returns a handle to this AbstractCondition's current target state.
 void setTargetState(State targetState)
          Sets the target state for this Condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.openai.util.fsm.Condition
satisfiedBy
 

Constructor Detail

AbstractCondition

public AbstractCondition()
Constructs a new AbstractCondition object.


AbstractCondition

public AbstractCondition(State targetState)
Constructs a new AbstractCondition with the given target state.

Parameters:
targetState - The target state for this AbstractCondition.
Method Detail

getTargetState

public final State getTargetState()
Returns a handle to this AbstractCondition's current target state.

Specified by:
getTargetState in interface Condition
Returns:
This AbstractCondition's target state.

setTargetState

public final void setTargetState(State targetState)
Sets the target state for this Condition. This is the state that will be the current state in the machine if this Condition is met.

NOTE: If the target state is null whenever this condition is being checked by the machine and it passes, then the result will be an UnhandledConditionException being thrown by the machine. Setting this to null is allowed because it will be necessary within a Graphical Building tool such as bean box or the planned extensions to the net.openai.gui.graph package.

Specified by:
setTargetState in interface Condition
Parameters:
targetState - The new target state.