public static List generatePrintableCharacterSet()

in core/src/main/java/site/ycsb/generator/IncrementingPrintableStringGenerator.java [347:387]


  public static List<Integer> generatePrintableCharacterSet(
      final int startCodePoint,
      final int lastCodePoint,
      final Set<Integer> characterTypesFilter,
      final boolean isFilterAllowableList,
      final Set<Integer> allowableTypes) {

    // since we don't know the final size of the allowable character list we
    // start with a list then we'll flatten it to an array.
    final List<Integer> validCharacters = new ArrayList<Integer>(lastCodePoint);

    for (int codePoint = startCodePoint; codePoint <= lastCodePoint; ++codePoint) {
      if (allowableTypes != null &&
          !allowableTypes.contains(Character.getType(codePoint))) {
        continue;
      } else {
        // skip control points, formats, surrogates, etc
        final int type = Character.getType(codePoint);
        if (type == Character.CONTROL ||
            type == Character.SURROGATE ||
            type == Character.FORMAT ||
            type == Character.PRIVATE_USE ||
            type == Character.UNASSIGNED) {
          continue;
        }
      }

      if (characterTypesFilter != null) {
        // if the filter is enabled then we need to make sure the code point 
        // is in the allowable list if it's a whitelist or that the code point
        // is NOT in the list if it's a blacklist.
        if ((isFilterAllowableList && !characterTypesFilter.contains(codePoint)) ||
            (characterTypesFilter.contains(codePoint))) {
          continue;
        }
      }

      validCharacters.add(codePoint);
    }
    return validCharacters;
  }