1 7 8 package com.sun.corba.se.spi.orbutil.fsm ; 9 10 import com.sun.corba.se.impl.orbutil.fsm.NameBase ; 11 12 import java.util.Map ; 13 import java.util.HashMap ; 14 import java.util.Set ; 15 import java.util.HashSet ; 16 17 import com.sun.corba.se.impl.orbutil.fsm.GuardedAction ; 18 import com.sun.corba.se.impl.orbutil.fsm.NameBase ; 19 20 23 public class StateImpl extends NameBase implements State { 24 private Action defaultAction ; 25 private State defaultNextState ; 26 private Map inputToGuardedActions ; 27 28 public StateImpl( String name ) 29 { 30 super( name ) ; 31 defaultAction = null ; 32 inputToGuardedActions = new HashMap () ; 33 } 34 35 public void preAction( FSM fsm ) 36 { 37 } 38 39 public void postAction( FSM fsm ) 40 { 41 } 42 43 45 public State getDefaultNextState() 46 { 47 return defaultNextState ; 48 } 49 50 public void setDefaultNextState( State defaultNextState ) 51 { 52 this.defaultNextState = defaultNextState ; 53 } 54 55 public Action getDefaultAction() 56 { 57 return defaultAction ; 58 } 59 60 public void setDefaultAction( Action defaultAction ) 61 { 62 this.defaultAction = defaultAction ; 63 } 64 65 public void addGuardedAction( Input in, GuardedAction ga ) 66 { 67 Set gas = (Set )inputToGuardedActions.get( in ) ; 68 if (gas == null) { 69 gas = new HashSet () ; 70 inputToGuardedActions.put( in, gas ) ; 71 } 72 73 gas.add( ga ) ; 74 } 75 76 public Set getGuardedActions( Input in ) 77 { 78 return (Set )inputToGuardedActions.get( in ) ; 79 } 80 } 81 82 | Popular Tags |