All Packages Class Hierarchy This Package Previous Next Index
Class hplb.xml.SAXAttributeMap
java.lang.Object
|
+----hplb.xml.SAXAttributeMap
- public class SAXAttributeMap
- extends Object
- implements AttributeMap
An ordered Dictionary. keys() and elements() returns Enumerations
which enumerate over elements in the order they were inserted.
Elements are stored linearly. Operations put(), get(), and remove()
are linear in the number of elements in the Dictionary.
Allows direct access to elements (as an alternative to using
Enumerators) for speed.
Can function as a bag, i.e. it can be created with a mode
which allows the same key to map to multiple entries. In this case
operations get() and remove() operate on the first pair in
the map. Hence to get hold of all values associated with a key it is
necessary to use the direct access to underlying arrays.
- Author:
- Anders Kristensen
-
elms
- List of values associated with keys.
-
keys
- The list of keys.
-
n
- Number of elements in the Dictionary.
-
SAXAttributeMap()
-
-
SAXAttributeMap(int)
- Create a SAXAttributeMap with the specififed initial cpacity.
-
clear()
-
-
getAttributeNames()
- Returns an enumeration of the keys in this dictionary.
-
getEntityPublicID(String)
-
-
getEntitySystemID(String)
-
-
getIndex(String)
-
-
getNotationName(String)
-
-
getNotationPublicID(String)
-
-
getNotationSystemID(String)
-
-
getValue(String)
- Returns the value to which the key is mapped in this dictionary.
-
isEmpty()
- Returns true if this dictionary maps no keys to value.
-
isEntity(String)
-
-
isId(String)
-
-
isIdref(String)
-
-
isNotation(String)
-
-
put(String, String)
- Maps the specified key to the specified value in this dictionary.
-
size()
- Returns the number of keys in this dictionary.
-
toString()
-
keys
public String keys[]
- The list of keys.
elms
public String elms[]
- List of values associated with keys.
n
public int n
- Number of elements in the Dictionary.
The elements are held at indices 0 to n in the keys and elms arrays.
SAXAttributeMap
public SAXAttributeMap()
SAXAttributeMap
public SAXAttributeMap(int size)
- Create a SAXAttributeMap with the specififed initial cpacity.
size
public synchronized int size()
- Returns the number of keys in this dictionary.
isEmpty
public synchronized boolean isEmpty()
- Returns true if this dictionary maps no keys to value.
getAttributeNames
public Enumeration getAttributeNames()
- Returns an enumeration of the keys in this dictionary.
getValue
public synchronized String getValue(String key)
- Returns the value to which the key is mapped in this dictionary.
getIndex
protected int getIndex(String key)
put
public synchronized String put(String key,
String value)
- Maps the specified key to the specified value in this dictionary.
Neither the key nor the value can be null.
The value can be retrieved by calling the get method with a key
that is equal to the original key.
- Returns:
- the previous value to which the key was mapped in
this dictionary, or null if the key did not have a
previous mapping.
clear
public void clear()
isEntity
public boolean isEntity(String aname)
isNotation
public boolean isNotation(String aname)
isId
public boolean isId(String aname)
isIdref
public boolean isIdref(String aname)
getEntityPublicID
public String getEntityPublicID(String aname)
getEntitySystemID
public String getEntitySystemID(String aname)
getNotationName
public String getNotationName(String aname)
getNotationPublicID
public String getNotationPublicID(String aname)
getNotationSystemID
public String getNotationSystemID(String aname)
toString
public synchronized String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index