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. package com.sun.corba.se.spi.orbutil.fsm ;
  8. /**
  9. * An FSM is used to represent an instance of a finite state machine
  10. * which has a transition function represented by an instance of
  11. * StateEngine. An instance of an FSM may be created either by calling
  12. * StateEngine.makeFSM( startState ) on a state engine, or by extending FSMImpl and
  13. * using a constructor. Using FSMImpl as a base class is convenient if
  14. * additional state is associated with the FSM beyond that encoded
  15. * by the current state. This is especially convenient if an action
  16. * needs some additional information. For example, counters are best
  17. * handled by special actions rather than encoding a bounded counter
  18. * in a state machine. It is also possible to create a class that
  19. * implements the FSM interface by delegating to an FSM instance
  20. * created by StateEngine.makeFSM.
  21. *
  22. * @version @(#)FSM.java 1.8 03/12/19
  23. * @author Ken Cavanaugh
  24. */
  25. public interface FSM
  26. {
  27. /** Get the current state of this FSM.
  28. */
  29. public State getState() ;
  30. /** Perform the action and transition to the next state based
  31. * on the current state of the FSM and the input.
  32. */
  33. public void doIt( Input in ) ;
  34. }
  35. // end of FSM.java