/** * Returns a state reached from this state with the given symbol. If more than one state can be reached with the given symbol, an arbitrary one is returned. * * @param symbol * @return a state reached from this state with the given symbol, <code>null</code> otherwise */ public State<T> move(final T symbol) { for (final Transition<T> t : _transitions) if (t.hasName(symbol)) return t.getTo(); return null; }
/** * Returns a state reached from this state with the given symbol. If more than one state can be reached with the given symbol, an arbitrary one is returned. * * @param symbol * @return a state reached from this state with the given symbol, <code>null</code> otherwise */ public State<T> move(final T symbol) { for (final Transition<T> t : _transitions) if (t.hasName(symbol)) return t.getTo(); return null; }
public Set<State<T>> move(final Set<State<T>> stateSet, final T c) { final Set<State<T>> result = new HashSet<>(); // for all the states in the set SS for (final State<T> st : stateSet) // for all the edges from state st for (final Transition<T> e : st.getTransitions()) // add the 'to' state if transition matches if (e.hasName(c)) result.add(e.getTo()); return result; }
public Set<State<T>> move(final Set<State<T>> stateSet, final T c) { final Set<State<T>> result = new HashSet<>(); // for all the states in the set SS for (final State<T> st : stateSet) // for all the edges from state st for (final Transition<T> e : st.getTransitions()) // add the 'to' state if transition matches if (e.hasName(c)) result.add(e.getTo()); return result; }