@Test public void rolloverOneCharacterOK() throws Exception { final IncrementingPrintableStringGenerator gen = new IncrementingPrintableStringGenerator(2, new int[] { 65 }); for (int i = 0; i < 5; i++) { assertEquals(gen.nextValue(), "AA"); } }
@Override public String nextValue() { if (hasRolledOver && throwExceptionOnRollover) { throw new NoSuchElementException("The generator has rolled over to the beginning"); } final StringBuilder buffer = new StringBuilder(length); for (int i = 0; i < length; i++) { buffer.append(Character.toChars(characterSet[indices[i]])); } for (int i = length - 1; i >= 0; --i) { if (indices[i] >= characterSet.length - 1) { indices[i] = 0; if (i == 0 || characterSet.length == 1 && lastValue != null) { hasRolledOver = true; } } else { ++indices[i]; break; } } lastValue = buffer.toString(); return lastValue; }
IncrementingPrintableStringGenerator extends Generator<String> { @Override public String nextValue() { if (hasRolledOver && throwExceptionOnRollover) { throw new NoSuchElementException("The generator has rolled over to the beginning"); } final StringBuilder buffer = new StringBuilder(length); for (int i = 0; i < length; i++) { buffer.append(Character.toChars(characterSet[indices[i]])); } for (int i = length - 1; i >= 0; --i) { if (indices[i] >= characterSet.length - 1) { indices[i] = 0; if (i == 0 || characterSet.length == 1 && lastValue != null) { hasRolledOver = true; } } else { ++indices[i]; break; } } lastValue = buffer.toString(); return lastValue; } }
IncrementingPrintableStringGenerator extends Generator<String> { @Override public String nextValue() { if (hasRolledOver && throwExceptionOnRollover) { throw new NoSuchElementException("The generator has rolled over to the beginning"); } final StringBuilder buffer = new StringBuilder(length); for (int i = 0; i < length; i++) { buffer.append(Character.toChars(characterSet[indices[i]])); } for (int i = length - 1; i >= 0; --i) { if (indices[i] >= characterSet.length - 1) { indices[i] = 0; if (i == 0 || characterSet.length == 1 && lastValue != null) { hasRolledOver = true; } } else { ++indices[i]; break; } } lastValue = buffer.toString(); return lastValue; } IncrementingPrintableStringGenerator();  IncrementingPrintableStringGenerator(final int length);  IncrementingPrintableStringGenerator(final int length, final int[] characterSet); }
IncrementingPrintableStringGenerator extends Generator<String> { @Override public String nextValue() { if (hasRolledOver && throwExceptionOnRollover) { throw new NoSuchElementException("The generator has rolled over to the beginning"); } final StringBuilder buffer = new StringBuilder(length); for (int i = 0; i < length; i++) { buffer.append(Character.toChars(characterSet[indices[i]])); } for (int i = length - 1; i >= 0; --i) { if (indices[i] >= characterSet.length - 1) { indices[i] = 0; if (i == 0 || characterSet.length == 1 && lastValue != null) { hasRolledOver = true; } } else { ++indices[i]; break; } } lastValue = buffer.toString(); return lastValue; } IncrementingPrintableStringGenerator();  IncrementingPrintableStringGenerator(final int length);  IncrementingPrintableStringGenerator(final int length, final int[] characterSet); @Override String nextValue(); @Override String lastValue(); void setThrowExceptionOnRollover(final boolean exceptionOnRollover); boolean getThrowExceptionOnRollover(); static int[] printableBasicAlphaASCIISet(); static int[] printableBasicAlphaNumericASCIISet(); static int[] fullPrintableBasicASCIISet(); static int[] fullPrintableBasicASCIISetWithNewlines(); static int[] printableAlphaNumericPlaneZeroSet(); static int[] fullPrintablePlaneZeroSet(); static List<Integer> generatePrintableCharacterSet(
      final int startCodePoint,
      final int lastCodePoint,
      final Set<Integer> characterTypesFilter,
      final boolean isFilterAllowableList,
      final Set<Integer> allowableTypes); }
IncrementingPrintableStringGenerator extends Generator<String> { @Override public String nextValue() { if (hasRolledOver && throwExceptionOnRollover) { throw new NoSuchElementException("The generator has rolled over to the beginning"); } final StringBuilder buffer = new StringBuilder(length); for (int i = 0; i < length; i++) { buffer.append(Character.toChars(characterSet[indices[i]])); } for (int i = length - 1; i >= 0; --i) { if (indices[i] >= characterSet.length - 1) { indices[i] = 0; if (i == 0 || characterSet.length == 1 && lastValue != null) { hasRolledOver = true; } } else { ++indices[i]; break; } } lastValue = buffer.toString(); return lastValue; } IncrementingPrintableStringGenerator();  IncrementingPrintableStringGenerator(final int length);  IncrementingPrintableStringGenerator(final int length, final int[] characterSet); @Override String nextValue(); @Override String lastValue(); void setThrowExceptionOnRollover(final boolean exceptionOnRollover); boolean getThrowExceptionOnRollover(); static int[] printableBasicAlphaASCIISet(); static int[] printableBasicAlphaNumericASCIISet(); static int[] fullPrintableBasicASCIISet(); static int[] fullPrintableBasicASCIISetWithNewlines(); static int[] printableAlphaNumericPlaneZeroSet(); static int[] fullPrintablePlaneZeroSet(); static List<Integer> generatePrintableCharacterSet(
      final int startCodePoint,
      final int lastCodePoint,
      final Set<Integer> characterTypesFilter,
      final boolean isFilterAllowableList,
      final Set<Integer> allowableTypes); static final int DEFAULTSTRINGLENGTH; static final Set<Integer> CHAR_TYPES_ALL_BUT_CONTROL; static final Set<Integer> CHAR_TYPES_BASIC_ALPHA; static final Set<Integer> CHAR_TYPES_BASIC_ALPHANUMERICS; static final Set<Integer> CHAR_TYPE_EXTENDED_ALPHANUMERICS; }