Extension SDK 10.1.2

oracle.ide.panels
Class FSMBuilder

java.lang.Object
  extended byoracle.ide.panels.FSMBuilder

public class FSMBuilder
extends java.lang.Object

This class provides the standard way of creating an FSM instance.


Constructor Summary
FSMBuilder()
          Initializes the FSMBuilder.
FSMBuilder(Step[] fsmSteps)
          Creates an FSMBuilder that is initialized to contain the specified Steps.
 
Method Summary
 void addStateTrans(java.lang.Object trans, java.lang.Object targetStateID)
          Adds the specified transition to the FSM state.
 FSM getFSM()
          Returns an FSM for the specification that has been built up using this FSMBuilder.
 void newFinalState(java.lang.Object stateID, Step step)
          Tells the builder to create a new final state in the FSM.
static FSM newFSM(Step[] steps)
          Returns an FSM that is entirely based on the sequence of Steps specified.
 void newStartState(Step step, java.lang.Object defaultTargetStateID)
          Tells the builder to create a new start state in the FSM.
 void newState(java.lang.Object stateID, Step step, java.lang.Object defaultTargetStateID)
          Tells the builder to create a new non-final state in the FSM.
 void newState(java.lang.Object stateID, Step step, java.lang.Object defaultTargetStateID, boolean isFinalState)
          Tells the builder to create a new state in the FSM.
 void setDefaultTrans(java.lang.Object targetStateID)
          Sets the specified target state ID as the default transition for the current FSM state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSMBuilder

public FSMBuilder()
Initializes the FSMBuilder. The newState() method should be called immediately after creating a new FSMBuilder; generally, you would want to create the START_STATE first.


FSMBuilder

public FSMBuilder(Step[] fsmSteps)
Creates an FSMBuilder that is initialized to contain the specified Steps.

Consider calling newFSM(Step[]) instead if you do not need to configure the FSMBuilder beyond the initial Step array.

Method Detail

newFSM

public static FSM newFSM(Step[] steps)
Returns an FSM that is entirely based on the sequence of Steps specified.

Throws:
java.lang.IllegalArgumentException - if the specified Step array is null or has no elements.

newStartState

public void newStartState(Step step,
                          java.lang.Object defaultTargetStateID)
Tells the builder to create a new start state in the FSM. An FSM can have only one start state. Using this method, the start state is configured as a non-final state. Use #newState(Object, Step, boolean) to add a start state that is also a final state. Subsequent calls to addStateTrans(..) will be relative to the newly created start state.

If the specified stateID already exists in the FSM, the existing state will be replaced.

Parameters:
defaultTargetStateID - The stateID of the state that this state should transition to by default when no explicit transition matches. If this parameter is null, no default target will be set.

newState

public void newState(java.lang.Object stateID,
                     Step step,
                     java.lang.Object defaultTargetStateID)
Tells the builder to create a new non-final state in the FSM. Subsequent calls to addStateTrans(..) will be relative to this newly created state.

If the specified stateID already exists in the FSM, the existing state will be replaced.

Parameters:
defaultTargetStateID - The stateID of the state that this state should transition to by default when no explicit transition matches. If this parameter is null, no default target will be set.

newFinalState

public void newFinalState(java.lang.Object stateID,
                          Step step)
Tells the builder to create a new final state in the FSM. Subsequent calls to addStateTrans(..) will be relative to this newly created state.

If the specified stateID already exists in the FSM, the existing state will be replaced.


newState

public void newState(java.lang.Object stateID,
                     Step step,
                     java.lang.Object defaultTargetStateID,
                     boolean isFinalState)
Tells the builder to create a new state in the FSM. Subsequent calls to addStateTrans(..) will be relative to this newly created state.

If the specified stateID already exists in the FSM, the existing state will be replaced.

Parameters:
stateID - The object that identifies the state in the FSM.
step - The Step that represents the activity of the state.
defaultTargetStateID - The stateID of the state that this state should transition to by default when no explicit transition matches. If this parameter is null, no default target will be set.
isFinalState -

setDefaultTrans

public void setDefaultTrans(java.lang.Object targetStateID)
Sets the specified target state ID as the default transition for the current FSM state.


addStateTrans

public void addStateTrans(java.lang.Object trans,
                          java.lang.Object targetStateID)
Adds the specified transition to the FSM state. Thus, whenever trans occurs in this FSM state, the FSM will move to the state identified by targetStateID.


getFSM

public FSM getFSM()
           throws FSMInvalidException
Returns an FSM for the specification that has been built up using this FSMBuilder. If the FSM specification is invalid, an FSMInvalidException is thrown.

Throws:
FSMInvalidException

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.