/** * Creates a state with {@link State.StateType#Normal} and adds it to the collection of created states. * Should be used instead of instantiating with new operator. * * @return the created state */ private State<T> createState(String name, State.StateType stateType) { String stateName = stateNameHandler.getUniqueInternalName(name); State<T> state = new State<>(stateName, stateType); states.add(state); return state; }
private NFA<Event> createStartEndNFA() { State<Event> startState = new State<>("start", State.StateType.Start); State<Event> endState = new State<>("end", State.StateType.Normal); State<Event> endingState = new State<>("", State.StateType.Final); startState.addTake( endState, new SimpleCondition<Event>() { private static final long serialVersionUID = -4869589195918650396L; @Override public boolean filter(Event value) throws Exception { return value.getName().equals("start"); } }); endState.addTake( endingState, new SimpleCondition<Event>() { private static final long serialVersionUID = 2979804163709590673L; @Override public boolean filter(Event value) throws Exception { return value.getName().equals("end"); } }); endState.addIgnore(BooleanConditions.<Event>trueFunction()); List<State<Event>> states = new ArrayList<>(); states.add(startState); states.add(endState); states.add(endingState); return new NFA<>(states, 2L, false); }
/** * Creates a state with {@link State.StateType#Normal} and adds it to the collection of created states. * Should be used instead of instantiating with new operator. * * @return the created state */ private State<T> createState(String name, State.StateType stateType) { String stateName = stateNameHandler.getUniqueInternalName(name); State<T> state = new State<>(stateName, stateType); states.add(state); return state; }
/** * Creates a state with {@link State.StateType#Normal} and adds it to the collection of created states. * Should be used instead of instantiating with new operator. * * @return the created state */ private State<T> createState(String name, State.StateType stateType) { String stateName = stateNameHandler.getUniqueInternalName(name); State<T> state = new State<>(stateName, stateType); states.add(state); return state; }
/** * Creates a state with {@link State.StateType#Normal} and adds it to the collection of created states. * Should be used instead of instantiating with new operator. * * @return the created state */ private State<T> createState(String name, State.StateType stateType) { String stateName = stateNameHandler.getUniqueInternalName(name); State<T> state = new State<>(stateName, stateType); states.add(state); return state; }
State.StateType stateType = stateTypeSerializer.deserialize(in); State<T> state = new State<>(stateName, stateType); states.put(stateName, state);
State<T> newFirst = new State<>(oldSecond.getName(), State.StateType.Start); convertedStates.put(newFirst.getName(), newFirst); while (oldSecondToThirdTake != null) { newSecond = new State<T>(oldSecondToThirdTake.getTargetState().getName(), State.StateType.Normal); convertedStates.put(newSecond.getName(), newSecond); newFirst.addTake(newSecond, oldFirstToSecondTake.getCondition()); final State<T> endingState = new State<>(ENDING_STATE_NAME, State.StateType.Final);