1 7 8 package com.sun.corba.se.spi.orbutil.fsm ; 9 10 import java.util.Set ; 11 import java.util.HashSet ; 12 13 import com.sun.corba.se.spi.orbutil.fsm.Input ; 14 import com.sun.corba.se.spi.orbutil.fsm.StateEngine ; 15 import com.sun.corba.se.impl.orbutil.fsm.StateEngineImpl ; 16 import com.sun.corba.se.impl.orbutil.ORBUtility ; 17 import com.sun.corba.se.spi.orbutil.fsm.FSM ; 18 19 27 public class FSMImpl implements FSM 28 { 29 private boolean debug ; 30 private State state ; 31 private StateEngineImpl stateEngine ; 32 33 36 public FSMImpl( StateEngine se, State startState ) 37 { 38 this( se, startState, false ) ; 39 } 40 41 public FSMImpl( StateEngine se, State startState, boolean debug ) 42 { 43 state = startState ; 44 stateEngine = (StateEngineImpl)se ; 45 this.debug = debug ; 46 } 47 48 50 public State getState() 51 { 52 return state ; 53 } 54 55 74 public void doIt( Input in ) 75 { 76 stateEngine.doIt( this, in, debug ) ; 77 } 78 79 81 public void internalSetState( State nextState ) 82 { 83 if (debug) { 84 ORBUtility.dprint( this, "Calling internalSetState with nextState = " + 85 nextState ) ; 86 } 87 88 state = nextState ; 89 90 if (debug) { 91 ORBUtility.dprint( this, "Exiting internalSetState with state = " + 92 state ) ; 93 } 94 } 95 } 96 97 99 | Popular Tags |