private Action getDefaultAction(StateImpl currentState) { Action action = currentState.getDefaultAction(); if (action == null) action = defaultAction; return action; }
private StateImpl getDefaultNextState(StateImpl currentState) { // Use the currentState defaults if set, otherwise use the state engine default. StateImpl nextState = (StateImpl) currentState.getDefaultNextState(); if (nextState == null) // The state engine default never changes the state nextState = currentState; return nextState; }
public StateEngine setDefault(State oldState, Action action, State newState) throws IllegalArgumentException, IllegalStateException { mustBeInitializing(); StateImpl oldStateImpl = (StateImpl) oldState; oldStateImpl.setDefaultAction(action); oldStateImpl.setDefaultNextState(newState); return this; }
try currentState.postAction(fsm); nextState.preAction(fsm);
public StateEngine add(State oldState, Input input, Guard guard, Action action, State newState) throws IllegalArgumentException, IllegalStateException { mustBeInitializing(); StateImpl oldStateImpl = (StateImpl) oldState; GuardedAction ga = new GuardedAction(guard, action, newState); oldStateImpl.addGuardedAction(input, ga); return this; }
Set<GuardedAction> gas = currentState.getGuardedActions(in); if (gas != null)
try currentState.postAction(fsm); nextState.preAction(fsm);
public StateEngine add(State oldState, Input input, Action action, State newState) throws IllegalArgumentException, IllegalStateException { mustBeInitializing(); StateImpl oldStateImpl = (StateImpl) oldState; GuardedAction ta = new GuardedAction(action, newState); oldStateImpl.addGuardedAction(input, ta); return this; }
Set<GuardedAction> gas = currentState.getGuardedActions(in); if (gas != null)
public StateEngine setDefault(State oldState, Action action, State newState) throws IllegalArgumentException, IllegalStateException { mustBeInitializing(); StateImpl oldStateImpl = (StateImpl) oldState; oldStateImpl.setDefaultAction(action); oldStateImpl.setDefaultNextState(newState); return this; }
public StateEngine add(State oldState, Input input, Guard guard, Action action, State newState) throws IllegalArgumentException, IllegalStateException { mustBeInitializing(); StateImpl oldStateImpl = (StateImpl) oldState; GuardedAction ga = new GuardedAction(guard, action, newState); oldStateImpl.addGuardedAction(input, ga); return this; }
private Action getDefaultAction(StateImpl currentState) { Action action = currentState.getDefaultAction(); if (action == null) action = defaultAction; return action; }
private StateImpl getDefaultNextState(StateImpl currentState) { // Use the currentState defaults if set, otherwise use the state engine default. StateImpl nextState = (StateImpl) currentState.getDefaultNextState(); if (nextState == null) // The state engine default never changes the state nextState = currentState; return nextState; }
public StateEngine add(State oldState, Input input, Action action, State newState) throws IllegalArgumentException, IllegalStateException { mustBeInitializing(); StateImpl oldStateImpl = (StateImpl) oldState; GuardedAction ta = new GuardedAction(action, newState); oldStateImpl.addGuardedAction(input, ta); return this; }