private int allocIndex(QNameMap<Integer> map, String nsUri, String localName) { Integer i = map.get(nsUri, localName); if (i == null) { i = map.size(); map.put(nsUri, localName, i); } return i; }
/** Wraps up everything and creates {@link NameList}. */ public NameList conclude() { boolean[] nsUriCannotBeDefaulted = new boolean[uriIndexMap.size()]; for (Map.Entry<String, Integer> e : uriIndexMap.entrySet()) { nsUriCannotBeDefaulted[e.getValue()] = nonDefaultableNsUris.contains(e.getKey()); } NameList r = new NameList( list(uriIndexMap), nsUriCannotBeDefaulted, list(localNameIndexMap), elementQNameIndexMap.size(), attributeQNameIndexMap.size()); // delete them so that the create method can never be called again uriIndexMap = null; localNameIndexMap = null; return r; }