private void buildDictionaryMemberLists() { // walk the lists of dictionary members and join them into a master list // for each dictionary. // each section must start with stop bit and type for the following // identifiers. All cache friendly forward motion. int dictionaryCount = dictionaryNames.size(); tokenIdxMembers = new int[dictionaryCount][]; tokenIdxMemberHeads = new int[dictionaryCount]; int j = resetList.size(); while (--j >= 0) { if (!resetList.get(j).isEmpty()) { final int d = j >>> TokenBuilder.BITS_TYPE; //only allocate exactly what is needed, when it is needed for the type needed if (null == tokenIdxMembers[d]) { tokenIdxMembers[d] = new int[lengthOfArrayForThisType(d)]; } int t = j & TokenBuilder.MASK_TYPE; int stopInt = 0xFFFF0000 | t; tokenIdxMembers[d][tokenIdxMemberHeads[d]++] = stopInt; // System.err.println("stopInt:"+stopInt+" "+Integer.toBinaryString(stopInt)+" "+TypeMask.toString(t)); for (Integer i : resetList.get(j)) { tokenIdxMembers[d][tokenIdxMemberHeads[d]++] = i.intValue(); } } } // tokenIdxMembers are ready to be saved but must be trimmed by heads }
private void buildDictionaryMemberLists() { // walk the lists of dictionary members and join them into a master list // for each dictionary. // each section must start with stop bit and type for the following // identifiers. All cache friendly forward motion. int dictionaryCount = dictionaryNames.size(); tokenIdxMembers = new int[dictionaryCount][]; tokenIdxMemberHeads = new int[dictionaryCount]; int j = resetList.size(); while (--j >= 0) { if (!resetList.get(j).isEmpty()) { final int d = j >>> TokenBuilder.BITS_TYPE; //only allocate exactly what is needed, when it is needed for the type needed if (null == tokenIdxMembers[d]) { tokenIdxMembers[d] = new int[lengthOfArrayForThisType(d)]; } int t = j & TokenBuilder.MASK_TYPE; int stopInt = 0xFFFF0000 | t; tokenIdxMembers[d][tokenIdxMemberHeads[d]++] = stopInt; // System.err.println("stopInt:"+stopInt+" "+Integer.toBinaryString(stopInt)+" "+TypeMask.toString(t)); for (Integer i : resetList.get(j)) { tokenIdxMembers[d][tokenIdxMemberHeads[d]++] = i.intValue(); } } } // tokenIdxMembers are ready to be saved but must be trimmed by heads }
private void buildDictionaryMemberLists() { // walk the lists of dictionary members and join them into a master list // for each dictionary. // each section must start with stop bit and type for the following // identifiers. All cache friendly forward motion. int dictionaryCount = dictionaryNames.size(); tokenIdxMembers = new int[dictionaryCount][]; tokenIdxMemberHeads = new int[dictionaryCount]; int j = resetList.size(); while (--j >= 0) { if (!resetList.get(j).isEmpty()) { final int d = j >>> TokenBuilder.BITS_TYPE; //only allocate exactly what is needed, when it is needed for the type needed if (null == tokenIdxMembers[d]) { tokenIdxMembers[d] = new int[lengthOfArrayForThisType(d)]; } int t = j & TokenBuilder.MASK_TYPE; int stopInt = 0xFFFF0000 | t; tokenIdxMembers[d][tokenIdxMemberHeads[d]++] = stopInt; // System.err.println("stopInt:"+stopInt+" "+Integer.toBinaryString(stopInt)+" "+TypeMask.toString(t)); for (Integer i : resetList.get(j)) { tokenIdxMembers[d][tokenIdxMemberHeads[d]++] = i.intValue(); } } } // tokenIdxMembers are ready to be saved but must be trimmed by heads }