KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > orbutil > fsm > FSM


1 /*
2  * @(#)FSM.java 1.8 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.spi.orbutil.fsm ;
9
10 /**
11  * An FSM is used to represent an instance of a finite state machine
12  * which has a transition function represented by an instance of
13  * StateEngine. An instance of an FSM may be created either by calling
14  * StateEngine.makeFSM( startState ) on a state engine, or by extending FSMImpl and
15  * using a constructor. Using FSMImpl as a base class is convenient if
16  * additional state is associated with the FSM beyond that encoded
17  * by the current state. This is especially convenient if an action
18  * needs some additional information. For example, counters are best
19  * handled by special actions rather than encoding a bounded counter
20  * in a state machine. It is also possible to create a class that
21  * implements the FSM interface by delegating to an FSM instance
22  * created by StateEngine.makeFSM.
23  *
24  * @version @(#)FSM.java 1.8 03/12/19
25  * @author Ken Cavanaugh
26  */

27 public interface FSM
28 {
29     /** Get the current state of this FSM.
30     */

31     public State getState() ;
32
33     /** Perform the action and transition to the next state based
34     * on the current state of the FSM and the input.
35     */

36     public void doIt( Input in ) ;
37 }
38
39 // end of FSM.java
40

41
Popular Tags