All Packages Class Hierarchy This Package Previous Next Index
Class hplb.xml.AttrListImpl
java.lang.Object
|
+----hplb.xml.AttrListImpl
- public class AttrListImpl
- extends Object
- implements AttributeList
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
-
-
n
- Number of elements.
-
AttrListImpl()
-
-
AttrListImpl(int)
- Create an AttrListImpl with the specififed initial capacity.
-
getAttribute(String)
- Returns the value to which the key is mapped in this dictionary.
-
getIndex(String)
-
-
getLength()
- Returns the number of keys in this dictionary.
-
item(int)
-
-
main(String[])
-
-
remove(String)
-
-
setAttribute(Attribute)
-
-
toString()
-
elms
protected Attribute elms[]
n
protected int n
- Number of elements. The elements are held at indices 0 to n in elms.
AttrListImpl
public AttrListImpl()
AttrListImpl
public AttrListImpl(int size)
- Create an AttrListImpl with the specififed initial capacity.
getAttribute
public synchronized Attribute getAttribute(String attrName)
- Returns the value to which the key is mapped in this dictionary.
getIndex
protected int getIndex(String name)
setAttribute
public synchronized Attribute setAttribute(Attribute attr)
remove
public synchronized Attribute remove(String attrName)
item
public synchronized Attribute item(int index)
getLength
public synchronized int getLength()
- Returns the number of keys in this dictionary.
toString
public synchronized String toString()
- Overrides:
- toString in class Object
main
public static void main(String args[]) throws Exception
All Packages Class Hierarchy This Package Previous Next Index