public final Entry obtainDynamicEntry(String key) { final int hash = hashHash(key.hashCode()); final int tableIndex = indexFor(hash, _table.length); for (Entry e = _table[tableIndex]; e != null; e = e._next) { if (e._hash == hash && eq(key, e._key)) { return e; } } return addEntry(key, hash, tableIndex); }
private final Entry getEntry(String key, int hash) { if (_readOnlyMap != null) { final Entry entry = _readOnlyMap.getEntry(key, hash); if (entry != null) { return entry; } } final int tableIndex = indexFor(hash, _table.length); for (Entry e = _table[tableIndex]; e != null; e = e._next) { if (e._hash == hash && eq(key, e._key)) { return e; } } return null; }
protected final void encodeElement(String namespaceURI, String qName, String localName) throws IOException { LocalNameQualifiedNamesMap.Entry entry = _v.elementName.obtainEntry(localName); if (entry._valueIndex > 0) { if (encodeElementMapEntry(entry, namespaceURI)) return; // Check the entry is a member of the read only map if (_v.elementName.isQNameFromReadOnlyMap(entry._value[0])) { entry = _v.elementName.obtainDynamicEntry(localName); if (entry._valueIndex > 0) { if (encodeElementMapEntry(entry, namespaceURI)) return; } } } encodeLiteralElementQualifiedNameOnThirdBit(namespaceURI, getPrefix(namespaceURI), localName, entry); }
private boolean encodeAttribute(String namespaceURI, String prefix, String localName) throws IOException { final LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(localName); for (int i = 0; i < entry._valueIndex; i++) { final QualifiedName name = entry._value[i]; if ((prefix == name.prefix || prefix.equals(name.prefix)) && (namespaceURI == name.namespaceName || namespaceURI.equals(name.namespaceName))) { encodeNonZeroIntegerOnSecondBitFirstBitZero(name.index); return true; } } entry.addQualifiedName(new QualifiedName(prefix, namespaceURI, localName, "", _v.attributeName.getNextIndex())); return false; }
public final int getNextAttributeIndex() { return _v.attributeName.getNextIndex(); }
public final void clear() { for (int i = 0; i < _table.length; i++) { _table[i] = null; } _size = 0; if (_readOnlyMap != null) { _index = _readOnlyMap.getIndex(); } else { _index = 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 transfer(Entry[] newTable) { Entry[] src = _table; int newCapacity = newTable.length; for (int j = 0; j < src.length; j++) { Entry e = src[j]; if (e != null) { src[j] = null; do { Entry next = e._next; int i = indexFor(e._hash, newCapacity); e._next = newTable[i]; newTable[i] = e; e = next; } while (e != null); } } }
protected final boolean encodeAttribute(String namespaceURI, String qName, String localName) throws IOException { LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(localName); if (entry._valueIndex > 0) { if (encodeAttributeMapEntry(entry, namespaceURI)) return true; // Check the entry is a member of the read only map if (_v.attributeName.isQNameFromReadOnlyMap(entry._value[0])) { entry = _v.attributeName.obtainDynamicEntry(localName); if (entry._valueIndex > 0) { if (encodeAttributeMapEntry(entry, namespaceURI)) return true; } } } return encodeLiteralAttributeQualifiedNameOnSecondBit(namespaceURI, getPrefix(namespaceURI), localName, entry); }
private boolean encodeAttribute(String namespaceURI, String prefix, String localName) throws IOException { final LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(localName); for (int i = 0; i < entry._valueIndex; i++) { final QualifiedName name = entry._value[i]; if ((prefix == name.prefix || prefix.equals(name.prefix)) && (namespaceURI == name.namespaceName || namespaceURI.equals(name.namespaceName))) { encodeNonZeroIntegerOnSecondBitFirstBitZero(name.index); return true; } } entry.addQualifiedName(new QualifiedName(prefix, namespaceURI, localName, "", _v.attributeName.getNextIndex())); return false; }
public final int getNextElementIndex() { return _v.elementName.getNextIndex(); }
public final void clear() { for (int i = 0; i < _table.length; i++) { _table[i] = null; } _size = 0; if (_readOnlyMap != null) { _index = _readOnlyMap.getIndex(); } else { _index = 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 transfer(Entry[] newTable) { Entry[] src = _table; int newCapacity = newTable.length; for (int j = 0; j < src.length; j++) { Entry e = src[j]; if (e != null) { src[j] = null; do { Entry next = e._next; int i = indexFor(e._hash, newCapacity); e._next = newTable[i]; newTable[i] = e; e = next; } while (e != null); } } }
public final Entry obtainDynamicEntry(String key) { final int hash = hashHash(key.hashCode()); final int tableIndex = indexFor(hash, _table.length); for (Entry e = _table[tableIndex]; e != null; e = e._next) { if (e._hash == hash && eq(key, e._key)) { return e; } } return addEntry(key, hash, tableIndex); }
protected final boolean encodeAttribute(String namespaceURI, String qName, String localName) throws IOException { LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(localName); if (entry._valueIndex > 0) { if (encodeAttributeMapEntry(entry, namespaceURI)) return true; // Check the entry is a member of the read only map if (_v.attributeName.isQNameFromReadOnlyMap(entry._value[0])) { entry = _v.attributeName.obtainDynamicEntry(localName); if (entry._valueIndex > 0) { if (encodeAttributeMapEntry(entry, namespaceURI)) return true; } } } return encodeLiteralAttributeQualifiedNameOnSecondBit(namespaceURI, getPrefix(namespaceURI), localName, entry); }
private boolean encodeAttribute(String namespaceURI, String prefix, String localName) throws IOException { final LocalNameQualifiedNamesMap.Entry entry = _v.attributeName.obtainEntry(localName); for (int i = 0; i < entry._valueIndex; i++) { final QualifiedName name = entry._value[i]; if ((prefix == name.prefix || prefix.equals(name.prefix)) && (namespaceURI == name.namespaceName || namespaceURI.equals(name.namespaceName))) { encodeNonZeroIntegerOnSecondBitFirstBitZero(name.index); return true; } } entry.addQualifiedName(new QualifiedName(prefix, namespaceURI, localName, "", _v.attributeName.getNextIndex())); return false; }
private final Entry getEntry(String key, int hash) { if (_readOnlyMap != null) { final Entry entry = _readOnlyMap.getEntry(key, hash); if (entry != null) { return entry; } } final int tableIndex = indexFor(hash, _table.length); for (Entry e = _table[tableIndex]; e != null; e = e._next) { if (e._hash == hash && eq(key, e._key)) { return e; } } return null; }