public final void setReadOnlyMap(FixedEntryStringIntMap readOnlyMap, boolean clear) { _readOnlyMap = readOnlyMap; if (_readOnlyMap != null) { readOnlyMap.removeFixedEntry(); _readOnlyMapSize = readOnlyMap.size(); _index = _readOnlyMapSize + _size; if (clear) { clear(); } } else { _readOnlyMapSize = 0; } }
public FixedEntryStringIntMap(String fixedEntry, int initialCapacity, float loadFactor) { super(initialCapacity, loadFactor); // Add the fixed entry final int hash = hashHash(fixedEntry.hashCode()); final int tableIndex = indexFor(hash, _table.length); _table[tableIndex] = _fixedEntry = new Entry(fixedEntry, hash, _index++, null); if (_size++ >= _threshold) { resize(2 * _table.length); } }
private void convertVocabulary(org.jvnet.fastinfoset.Vocabulary v) { final StringIntMap prefixMap = new FixedEntryStringIntMap( EncodingConstants.XML_NAMESPACE_PREFIX, 8); final StringIntMap namespaceNameMap = new FixedEntryStringIntMap( EncodingConstants.XML_NAMESPACE_NAME, 8); final StringIntMap localNameMap = new StringIntMap(); addToTable(v.restrictedAlphabets.iterator(), restrictedAlphabet); addToTable(v.encodingAlgorithms.iterator(), encodingAlgorithm); addToTable(v.prefixes.iterator(), prefix, prefixMap); addToTable(v.namespaceNames.iterator(), namespaceName, namespaceNameMap); addToTable(v.localNames.iterator(), localName, localNameMap); addToTable(v.otherNCNames.iterator(), otherNCName); addToTable(v.otherURIs.iterator(), otherURI); addToTable(v.attributeValues.iterator(), attributeValue); addToTable(v.otherStrings.iterator(), otherString); addToTable(v.characterContentChunks.iterator(), characterContentChunk); addToTable(v.elements.iterator(), elementName, false, prefixMap, namespaceNameMap, localNameMap); addToTable(v.attributes.iterator(), attributeName, true, prefixMap, namespaceNameMap, localNameMap); }
public final void clear() { for (int i = 0; i < _table.length; i++) { _table[i] = null; } _lastEntry = NULL_ENTRY; if (_fixedEntry != null) { final int tableIndex = indexFor(_fixedEntry._hash, _table.length); _table[tableIndex] = _fixedEntry; _fixedEntry._next = null; _size = 1; _index = _readOnlyMapSize + 1; } else { _size = 0; _index = _readOnlyMapSize; } }
public final void setReadOnlyMap(KeyIntMap readOnlyMap, boolean clear) { if (!(readOnlyMap instanceof FixedEntryStringIntMap)) { throw new IllegalArgumentException(CommonResourceBundle.getInstance(). getString("message.illegalClass", new Object[]{readOnlyMap})); } setReadOnlyMap((FixedEntryStringIntMap)readOnlyMap, clear); }
private void convertVocabulary(org.jvnet.fastinfoset.Vocabulary v) { final StringIntMap prefixMap = new FixedEntryStringIntMap( EncodingConstants.XML_NAMESPACE_PREFIX, 8); final StringIntMap namespaceNameMap = new FixedEntryStringIntMap( EncodingConstants.XML_NAMESPACE_NAME, 8); final StringIntMap localNameMap = new StringIntMap(); addToTable(v.restrictedAlphabets.iterator(), restrictedAlphabet); addToTable(v.encodingAlgorithms.iterator(), encodingAlgorithm); addToTable(v.prefixes.iterator(), prefix, prefixMap); addToTable(v.namespaceNames.iterator(), namespaceName, namespaceNameMap); addToTable(v.localNames.iterator(), localName, localNameMap); addToTable(v.otherNCNames.iterator(), otherNCName); addToTable(v.otherURIs.iterator(), otherURI); addToTable(v.attributeValues.iterator(), attributeValue); addToTable(v.otherStrings.iterator(), otherString); addToTable(v.characterContentChunks.iterator(), characterContentChunk); addToTable(v.elements.iterator(), elementName, false, prefixMap, namespaceNameMap, localNameMap); addToTable(v.attributes.iterator(), attributeName, true, prefixMap, namespaceNameMap, localNameMap); }
public final void clear() { for (int i = 0; i < _table.length; i++) { _table[i] = null; } _lastEntry = NULL_ENTRY; if (_fixedEntry != null) { final int tableIndex = indexFor(_fixedEntry._hash, _table.length); _table[tableIndex] = _fixedEntry; _fixedEntry._next = null; _size = 1; _index = _readOnlyMapSize + 1; } else { _size = 0; _index = _readOnlyMapSize; } }
public final void setReadOnlyMap(KeyIntMap readOnlyMap, boolean clear) { if (!(readOnlyMap instanceof FixedEntryStringIntMap)) { throw new IllegalArgumentException(CommonResourceBundle.getInstance(). getString("message.illegalClass", new Object[]{readOnlyMap})); } setReadOnlyMap((FixedEntryStringIntMap)readOnlyMap, clear); }
public FixedEntryStringIntMap(String fixedEntry, int initialCapacity, float loadFactor) { super(initialCapacity, loadFactor); // Add the fixed entry final int hash = hashHash(fixedEntry.hashCode()); final int tableIndex = indexFor(hash, _table.length); _table[tableIndex] = _fixedEntry = new Entry(fixedEntry, hash, _index++, null); if (_size++ >= _threshold) { resize(2 * _table.length); } }
public final void setReadOnlyMap(FixedEntryStringIntMap readOnlyMap, boolean clear) { _readOnlyMap = readOnlyMap; if (_readOnlyMap != null) { readOnlyMap.removeFixedEntry(); _readOnlyMapSize = readOnlyMap.size(); _index = _readOnlyMapSize + _size; if (clear) { clear(); } } else { _readOnlyMapSize = 0; } }
private void convertVocabulary(org.jvnet.fastinfoset.Vocabulary v) { final StringIntMap prefixMap = new FixedEntryStringIntMap( EncodingConstants.XML_NAMESPACE_PREFIX, 8); final StringIntMap namespaceNameMap = new FixedEntryStringIntMap( EncodingConstants.XML_NAMESPACE_NAME, 8); final StringIntMap localNameMap = new StringIntMap(); addToTable(v.restrictedAlphabets.iterator(), restrictedAlphabet); addToTable(v.encodingAlgorithms.iterator(), encodingAlgorithm); addToTable(v.prefixes.iterator(), prefix, prefixMap); addToTable(v.namespaceNames.iterator(), namespaceName, namespaceNameMap); addToTable(v.localNames.iterator(), localName, localNameMap); addToTable(v.otherNCNames.iterator(), otherNCName); addToTable(v.otherURIs.iterator(), otherURI); addToTable(v.attributeValues.iterator(), attributeValue); addToTable(v.otherStrings.iterator(), otherString); addToTable(v.characterContentChunks.iterator(), characterContentChunk); addToTable(v.elements.iterator(), elementName, false, prefixMap, namespaceNameMap, localNameMap); addToTable(v.attributes.iterator(), attributeName, true, prefixMap, namespaceNameMap, localNameMap); }
public final void clear() { for (int i = 0; i < _table.length; i++) { _table[i] = null; } _lastEntry = NULL_ENTRY; if (_fixedEntry != null) { final int tableIndex = indexFor(_fixedEntry._hash, _table.length); _table[tableIndex] = _fixedEntry; _fixedEntry._next = null; _size = 1; _index = _readOnlyMapSize + 1; } else { _size = 0; _index = _readOnlyMapSize; } }
public final void setReadOnlyMap(KeyIntMap readOnlyMap, boolean clear) { if (!(readOnlyMap instanceof FixedEntryStringIntMap)) { throw new IllegalArgumentException(CommonResourceBundle.getInstance(). getString("message.illegalClass", new Object[]{readOnlyMap})); } setReadOnlyMap((FixedEntryStringIntMap)readOnlyMap, clear); }
public FixedEntryStringIntMap(String fixedEntry, int initialCapacity, float loadFactor) { super(initialCapacity, loadFactor); // Add the fixed entry final int hash = hashHash(fixedEntry.hashCode()); final int tableIndex = indexFor(hash, _table.length); _table[tableIndex] = _fixedEntry = new Entry(fixedEntry, hash, _index++, null); if (_size++ >= _threshold) { resize(2 * _table.length); } }
public final void setReadOnlyMap(FixedEntryStringIntMap readOnlyMap, boolean clear) { _readOnlyMap = readOnlyMap; if (_readOnlyMap != null) { readOnlyMap.removeFixedEntry(); _readOnlyMapSize = readOnlyMap.size(); _index = _readOnlyMapSize + _size; if (clear) { clear(); } } else { _readOnlyMapSize = 0; } }
public SerializerVocabulary() { tables[RESTRICTED_ALPHABET] = restrictedAlphabet = new StringIntMap(4); tables[ENCODING_ALGORITHM] = encodingAlgorithm = new StringIntMap(4); tables[PREFIX] = prefix = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_PREFIX, 8); tables[NAMESPACE_NAME] = namespaceName = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_NAME, 8); tables[LOCAL_NAME] = localName = new StringIntMap(); tables[OTHER_NCNAME] = otherNCName = new StringIntMap(4); tables[OTHER_URI] = otherURI = new StringIntMap(4); tables[ATTRIBUTE_VALUE] = attributeValue = new StringIntMap(); tables[OTHER_STRING] = otherString = new CharArrayIntMap(4); tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk = new CharArrayIntMap(); tables[ELEMENT_NAME] = elementName = new LocalNameQualifiedNamesMap(); tables[ATTRIBUTE_NAME] = attributeName = new LocalNameQualifiedNamesMap(); }
private final void removeFixedEntry() { if (_fixedEntry != null) { final int tableIndex = indexFor(_fixedEntry._hash, _table.length); final Entry firstEntry = _table[tableIndex]; if (firstEntry == _fixedEntry) { _table[tableIndex] = _fixedEntry._next; } else { Entry previousEntry = firstEntry; while (previousEntry._next != _fixedEntry) { previousEntry = previousEntry._next; } previousEntry._next = _fixedEntry._next; } _fixedEntry = null; _size--; } } }
public SerializerVocabulary() { tables[RESTRICTED_ALPHABET] = restrictedAlphabet = new StringIntMap(4); tables[ENCODING_ALGORITHM] = encodingAlgorithm = new StringIntMap(4); tables[PREFIX] = prefix = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_PREFIX, 8); tables[NAMESPACE_NAME] = namespaceName = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_NAME, 8); tables[LOCAL_NAME] = localName = new StringIntMap(); tables[OTHER_NCNAME] = otherNCName = new StringIntMap(4); tables[OTHER_URI] = otherURI = new StringIntMap(4); tables[ATTRIBUTE_VALUE] = attributeValue = new StringIntMap(); tables[OTHER_STRING] = otherString = new CharArrayIntMap(4); tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk = new CharArrayIntMap(); tables[ELEMENT_NAME] = elementName = new LocalNameQualifiedNamesMap(); tables[ATTRIBUTE_NAME] = attributeName = new LocalNameQualifiedNamesMap(); }
private final void removeFixedEntry() { if (_fixedEntry != null) { final int tableIndex = indexFor(_fixedEntry._hash, _table.length); final Entry firstEntry = _table[tableIndex]; if (firstEntry == _fixedEntry) { _table[tableIndex] = _fixedEntry._next; } else { Entry previousEntry = firstEntry; while (previousEntry._next != _fixedEntry) { previousEntry = previousEntry._next; } previousEntry._next = _fixedEntry._next; } _fixedEntry = null; _size--; } } }
public SerializerVocabulary() { tables[RESTRICTED_ALPHABET] = restrictedAlphabet = new StringIntMap(4); tables[ENCODING_ALGORITHM] = encodingAlgorithm = new StringIntMap(4); tables[PREFIX] = prefix = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_PREFIX, 8); tables[NAMESPACE_NAME] = namespaceName = new FixedEntryStringIntMap(EncodingConstants.XML_NAMESPACE_NAME, 8); tables[LOCAL_NAME] = localName = new StringIntMap(); tables[OTHER_NCNAME] = otherNCName = new StringIntMap(4); tables[OTHER_URI] = otherURI = new StringIntMap(4); tables[ATTRIBUTE_VALUE] = attributeValue = new StringIntMap(); tables[OTHER_STRING] = otherString = new CharArrayIntMap(4); tables[CHARACTER_CONTENT_CHUNK] = characterContentChunk = new CharArrayIntMap(); tables[ELEMENT_NAME] = elementName = new LocalNameQualifiedNamesMap(); tables[ATTRIBUTE_NAME] = attributeName = new LocalNameQualifiedNamesMap(); }