/** * Performs transitions in extended transition function. [Martin, Def. 2.12] * @return delta*(q,s) * @exception IllegalArgumentException if a symbol in s is not in the alphabet */ public State deltaStar(State q, String s) throws IllegalArgumentException { // (Using recursion instead of iteration would have been closer to // the mathematical definition, but this code is simpler...) for (char c : s.toCharArray()) q = delta(q,c); return q; }