net.openai.util.fsm
Interface Condition

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractCondition, AnyCondition, BooleanCondition, ComparableCondition, EqualsCondition, NotCondition, NullCondition

public interface Condition
extends java.io.Serializable

This is the base class for all Conditions


Method Summary
 State getTargetState()
          Returns a handle to this Condition's current target state.
 boolean satisfiedBy(java.lang.Object conditional)
          Called to check if the conditional meets the criteria defined by this state.
 void setTargetState(State targetState)
          Sets the target state for this Condition.
 

Method Detail

getTargetState

State getTargetState()
Returns a handle to this Condition's current target state.

Returns:
This Condition's target state.

setTargetState

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.

Parameters:
targetState - The new target state.

satisfiedBy

boolean satisfiedBy(java.lang.Object conditional)
Called to check if the conditional meets the criteria defined by this state. This is the only method to implement in order to used this interface.

Parameters:
conditional - The object to check.
Returns:
Implementors should return true if this condition is met by the Object conditional and false otherwise.