package org.glassfish.pfl.basic.fsm ;
public final class Transition {
private static Guard trueGuard = new Guard.Base( "true" ) {
@Override
public Guard.Result evaluate( FSM fsm, Input in )
{
return Guard.Result.ENABLED ;
}
} ;
private Guard guard ;
private Action action ;
private State nextState ;
Transition( Action action, State nextState )
{
this.guard = trueGuard ;
this.action = action ;
this.nextState = nextState ;
}
Transition( Guard guard, Action action, State nextState )
{
this.guard = guard ;
this.action = action ;
this.nextState = nextState ;
}
@Override
public String toString() {
return "Transition[action=" + action + " guard=" + guard +
" nextState=" + nextState + "]" ;
}
public Action getAction() { return action ; }
public Guard getGuard() { return guard ; }
public State getNextState() { return nextState ; }
}