1 7 8 package com.sun.corba.se.impl.orbutil.fsm ; 9 10 import com.sun.corba.se.spi.orbutil.fsm.Guard ; 11 import com.sun.corba.se.spi.orbutil.fsm.GuardBase ; 12 import com.sun.corba.se.spi.orbutil.fsm.Input ; 13 import com.sun.corba.se.spi.orbutil.fsm.Action ; 14 import com.sun.corba.se.spi.orbutil.fsm.State ; 15 import com.sun.corba.se.spi.orbutil.fsm.FSM ; 16 17 public class GuardedAction { 18 private static Guard trueGuard = new GuardBase( "true" ) { 19 public Guard.Result evaluate( FSM fsm, Input in ) 20 { 21 return Guard.Result.ENABLED ; 22 } 23 } ; 24 25 private Guard guard ; 26 private Action action ; 27 private State nextState ; 28 29 public GuardedAction( Action action, State nextState ) 30 { 31 this.guard = trueGuard ; 32 this.action = action ; 33 this.nextState = nextState ; 34 } 35 36 public GuardedAction( Guard guard, Action action, State nextState ) 37 { 38 this.guard = guard ; 39 this.action = action ; 40 this.nextState = nextState ; 41 } 42 43 public String toString() 44 { 45 return "GuardedAction[action=" + action + " guard=" + guard + 46 " nextState=" + nextState + "]" ; 47 } 48 49 public Action getAction() { return action ; } 50 public Guard getGuard() { return guard ; } 51 public State getNextState() { return nextState ; } 52 } 53 54 | Popular Tags |