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

Variable Index

 o elms
 o n
Number of elements.

Constructor Index

 o AttrListImpl()
 o AttrListImpl(int)
Create an AttrListImpl with the specififed initial capacity.

Method Index

 o getAttribute(String)
Returns the value to which the key is mapped in this dictionary.
 o getIndex(String)
 o getLength()
Returns the number of keys in this dictionary.
 o item(int)
 o main(String[])
 o remove(String)
 o setAttribute(Attribute)
 o toString()

Variables

 o elms
 protected Attribute elms[]
 o n
 protected int n
Number of elements. The elements are held at indices 0 to n in elms.

Constructors

 o AttrListImpl
 public AttrListImpl()
 o AttrListImpl
 public AttrListImpl(int size)
Create an AttrListImpl with the specififed initial capacity.

Methods

 o getAttribute
 public synchronized Attribute getAttribute(String attrName)
Returns the value to which the key is mapped in this dictionary.

 o getIndex
 protected int getIndex(String name)
 o setAttribute
 public synchronized Attribute setAttribute(Attribute attr)
 o remove
 public synchronized Attribute remove(String attrName)
 o item
 public synchronized Attribute item(int index)
 o getLength
 public synchronized int getLength()
Returns the number of keys in this dictionary.

 o toString
 public synchronized String toString()
Overrides:
toString in class Object
 o main
 public static void main(String args[]) throws Exception

All Packages  Class Hierarchy  This Package  Previous  Next  Index