org.xml.sax.Attributes
| Modifier and Type | Field and Description |
|---|---|
| private final StringBuffer | |
| private final Map | m_indexFromQName
Hash table of qName/index values to quickly lookup the index of an attributes qName. |
| private static final int | MAX
This is the number of attributes before switching to the hash table, and can be tuned, but 12 seems good for now - Brian M. |
| private static final int | MAXMinus1
One less than the number of attributes before switching to the Map. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | addAttribute(String
the URI of the attribute uri, String the local name of the attribute local, String the qualified name of the attribute qname, String the type of the attribute type, String the value of the attribute val)Overrides org. This method adds the attribute, but also records its qName/index pair in the hashtable for fast lookup by getIndex(qName). |
| public final void | clear()
Overrides org. This method clears the accumulated attributes. |
| public final int | Returns: the integer index of the attribute.the qualified name of the attribute, e.g. "prefix1:locName1" qname)Overrides org. Implements org. This method gets the index of an attribute given its qName. |
| public final int | Returns: the integer index of the attribute.the URI of the attribute name. uri, String the local namer (after the ':' ) of the attribute name. localName)Overrides org. Implements org. This method gets the index of an attribute given its uri and locanName. |
| public final void | setAttributes(Attributes
the attributes to copy into these attributes. atts)Overrides org. This method sets the attributes, previous attributes are cleared, it also keeps the hashtable up to date for quick lookup via getIndex(qName). |
| private void | switchOverToHash(int numAtts)
We are switching over to having a hash table for quick look up of attributes, but up until now we haven't kept any information in the Map, so we now update the Map. |
| m_buff | back to summary |
|---|---|
| private final StringBuffer m_buff | |
| m_indexFromQName | back to summary |
|---|---|
| private final Map<String, Integer> m_indexFromQName Hash table of qName/index values to quickly lookup the index of an attributes qName. qNames are in uppercase in the hash table to make the search case insensitive. The keys to the hashtable to find the index are either "prefix:localName" or "{uri}localName". | |
| MAX | back to summary |
|---|---|
| private static final int MAX This is the number of attributes before switching to the hash table, and can be tuned, but 12 seems good for now - Brian M. | |
| MAXMinus1 | back to summary |
|---|---|
| private static final int MAXMinus1 One less than the number of attributes before switching to the Map. | |
| AttributesImplSerializer | back to summary |
|---|---|
| public AttributesImplSerializer() | |
| addAttribute | back to summary |
|---|---|
| public final void addAttribute(String uri, String local, String qname, String type, String val) Overrides org. This method adds the attribute, but also records its qName/index pair in the hashtable for fast lookup by getIndex(qName). | |
| clear | back to summary |
|---|---|
| public final void clear() Overrides org. This method clears the accumulated attributes. | |
| getIndex | back to summary |
|---|---|
| public final int getIndex(String qname) Overrides org. Implements org. This method gets the index of an attribute given its qName.
| |
| getIndex | back to summary |
|---|---|
| public final int getIndex(String uri, String localName) Overrides org. Implements org. This method gets the index of an attribute given its uri and locanName.
| |
| setAttributes | back to summary |
|---|---|
| public final void setAttributes(Attributes atts) Overrides org. This method sets the attributes, previous attributes are cleared, it also keeps the hashtable up to date for quick lookup via getIndex(qName).
| |
| switchOverToHash | back to summary |
|---|---|
| private void switchOverToHash(int numAtts) We are switching over to having a hash table for quick look up of attributes, but up until now we haven't kept any information in the Map, so we now update the Map. Future additional attributes will update the Map as they are added. | |