private boolean nextString(int state,int position){
  int c=0;
  if (position < seekBytesRef.length()) {
    c=seekBytesRef.byteAt(position) & 0xff;
    if (c++ == 0xff)     return false;
  }
  seekBytesRef.setLength(position);
  visited[state]=curGen;
  final int numTransitions=automaton.getNumTransitions(state);
  automaton.initTransition(state,transition);
  for (int i=0; i < numTransitions; i++) {
    automaton.getNextTransition(transition);
    if (transition.max >= c) {
      int nextChar=Math.max(c,transition.min);
      seekBytesRef.grow(seekBytesRef.length() + 1);
      seekBytesRef.append((byte)nextChar);
      state=transition.dest;
      while (visited[state] != curGen && !runAutomaton.isAccept(state)) {
        visited[state]=curGen;
        automaton.initTransition(state,transition);
        automaton.getNextTransition(transition);
        state=transition.dest;
        seekBytesRef.grow(seekBytesRef.length() + 1);
        seekBytesRef.append((byte)transition.min);
        if (!finite && !linear && visited[state] == curGen) {
          setLinear(seekBytesRef.length() - 1);
        }
      }
      return true;
    }
  }
  return false;
}

private boolean nextString ( int state , int position ) { int c = 0 ; if ( position < seekBytesRef . length ( ) ) { c = seekBytesRef . byteAt ( position ) & 0xff ; if ( c ++ == 0xff ) return false ; } seekBytesRef . setLength ( position ) ; visited [ state ] = curGen ; final int numTransitions = automaton . getNumTransitions ( state ) ; automaton . initTransition ( state , transition ) ; for ( int i = 0 ; i < numTransitions ; i ++ ) { automaton . getNextTransition ( transition ) ; if ( transition . max >= c ) { int nextChar = Math . max ( c , transition . min ) ; seekBytesRef . grow ( seekBytesRef . length ( ) + 1 ) ; seekBytesRef . append ( ( byte ) nextChar ) ; state = transition . dest ; while ( visited [ state ] != curGen && ! runAutomaton . isAccept ( state ) ) { visited [ state ] = curGen ; automaton . initTransition ( state , transition ) ; automaton . getNextTransition ( transition ) ; state = transition . dest ; seekBytesRef . grow ( seekBytesRef . length ( ) + 1 ) ; seekBytesRef . append ( ( byte ) transition . min ) ; if ( ! finite && ! linear && visited [ state ] == curGen ) { setLinear ( seekBytesRef . length ( ) - 1 ) ; } } return true ; } } return false ; }
returns the next string in lexicographic order that will not put the machine into a reject state . this method traverses the dfa from the given position in the string , starting at the given state . if this cannot satisfy the machine , returns false . this method will walk the minimal path , in lexicographic order , as long as possible . if this method returns false , then there might still be more solutions , it is necessary to backtrack to find out .
