public String sequence(int hashCode) {
        if (hashCode <= 0)
            return null;

        int state = 0;

        // If the hash code is larger than the number of suffixes in the start state,
        // the hash code does not correspond to a sequence.
        if (hashCode > d_stateNSuffixes.get(state))
            return null;

        StringBuilder wordBuilder = new StringBuilder();

        // Stop if we are in a state where we cannot add more characters.
        while (d_stateOffsets.get(state) != transitionsUpperBound(state)) {

            // Obtain the next transition, decreasing the hash code by the number of
            // preceding suffixes.
            int trans;
            for (trans = d_stateOffsets.get(state); trans < transitionsUpperBound(state); ++trans) {
                int stateNSuffixes = d_stateNSuffixes.get(d_transitionTo.get(trans));

                if (hashCode - stateNSuffixes <= 0)
                    break;

                hashCode -= stateNSuffixes;
            }

            // Add the character on the given transition and move.
            wordBuilder.append(d_transitionChars[trans]);
            state = d_transitionTo.get(trans);

            // If we encounter a final state, decrease the hash code, since it represents a
            // suffix. If our hash code is reduced to zero, we have found the sequence.
            if (d_finalStates.get(state)) {
                --hashCode;

                if (hashCode == 0)
                    return wordBuilder.toString();
            }
        }

        // Bad luck, we cannot really get here!
        return null;
    }
public String sequence ( int hashCode ) { if ( hashCode <= 0 ) return null ; int state = 0 ; if ( hashCode > d_stateNSuffixes . get ( state ) ) return null ; StringBuilder wordBuilder = new StringBuilder ( ) ; while ( d_stateOffsets . get ( state ) != transitionsUpperBound ( state ) ) { int trans ; for ( trans = d_stateOffsets . get ( state ) ; trans < transitionsUpperBound ( state ) ; ++ trans ) { int stateNSuffixes = d_stateNSuffixes . get ( d_transitionTo . get ( trans ) ) ; if ( hashCode - stateNSuffixes <= 0 ) break ; hashCode -= stateNSuffixes ; } wordBuilder . append ( d_transitionChars [ trans ] ) ; state = d_transitionTo . get ( trans ) ; if ( d_finalStates . get ( state ) ) { -- hashCode ; if ( hashCode == 0 ) return wordBuilder . toString ( ) ; } } return null ; }
Compute the sequence corresponding to the given hash code.

@param hashCode
@return