*/
final class CaseInsensitiveMap {
- private static int CHUNK_SHIFT = 10; /* 2^10 = 1k */
- private static int CHUNK_SIZE = (1<<CHUNK_SHIFT);
- private static int CHUNK_MASK = (CHUNK_SIZE-1);
- private static int INITIAL_CHUNK_COUNT = 64; /* up to 0xFFFF */
+ private static final int CHUNK_SHIFT = 10; /* 2^10 = 1k */
+ private static final int CHUNK_SIZE = (1<<CHUNK_SHIFT);
+ private static final int CHUNK_MASK = (CHUNK_SIZE-1);
+ private static final int INITIAL_CHUNK_COUNT = 64; /* up to 0xFFFF */
- private static int[][][] caseInsensitiveMap;
+ private static final int[][][] caseInsensitiveMap;
- private static int LOWER_CASE_MATCH = 1;
- private static int UPPER_CASE_MATCH = 2;
-
- static {
- buildCaseInsensitiveMap();
- }
+ private static final int LOWER_CASE_MATCH = 1;
+ private static final int UPPER_CASE_MATCH = 2;
/**
* Return a list of code point characters (not including the input value)
* that can be substituted in a case insensitive match
*/
- static public int[] get(int codePoint) {
+ static int[] get(int codePoint) {
return (codePoint < 0x10000) ? getMapping(codePoint) : null;
}
return caseInsensitiveMap[chunk][offset];
}
- private static void buildCaseInsensitiveMap() {
+ static {
caseInsensitiveMap = new int[INITIAL_CHUNK_COUNT][CHUNK_SIZE][];
int lc, uc;
for (int i=0; i<0x10000; i++) {