// merge the character maps, allowing definitions in a later map
// to overwrite definitions in an earlier map. (Note, we don't really
// need to do this if there is only one map, but we want to scan the keys
// anyway to extract the mimimum and maximum mapped characters.)
charMap = new IntHashMap(64);
for (int i = 0; i < maps.size(); i++) {
IntHashMap hashMap = (IntHashMap)maps.get(i);
IntIterator keys = hashMap.keyIterator();
while (keys.hasNext()) {
int next = keys.next();
if (next < min) {
min = next;
}
if (next > max) {
max = next;
}
if (!mapsWhitespace && Whitespace.isWhitespace(next)) {
mapsWhitespace = true;
}
charMap.put(next, hashMap.get(next));
}
}
if (min > 0xD800) {
// if all the mapped characters are above the BMP, we need to check
// surrogates