Here you can find the source of toIdSet(boolean includeAlphaCharacters, String nonAlphaCharacters)
private static int[] toIdSet(boolean includeAlphaCharacters, String nonAlphaCharacters)
//package com.java2s; //License from project: Apache License public class Main { /**/* w w w .ja v a 2 s. c om*/ * Encodes a set of ASCII characters (< 127) as a bitset of 4 32-bit values. */ private static int[] toIdSet(boolean includeAlphaCharacters, String nonAlphaCharacters) { int[] bits = new int[4]; // 4*32=128 which covers all ASCII if (includeAlphaCharacters) { for (int ch = 'A'; ch <= 'Z'; ch++) { bits[ch >>> 5] |= (1 << (ch & 31)); } for (int ch = 'a'; ch <= 'z'; ch++) { bits[ch >>> 5] |= (1 << (ch & 31)); } } for (int i = 0; i < nonAlphaCharacters.length(); i++) { int ch = nonAlphaCharacters.charAt(i); if (ch >= 128) { throw new AssertionError(); // out of range } bits[ch >>> 5] |= (1 << (ch & 31)); } return bits; } }