antlr.collections.impl
Class IndexedVector

java.lang.Object
  |
  +--antlr.collections.impl.IndexedVector

public class IndexedVector
extends Object

A simple indexed vector: a normal vector except that you must specify a key when adding an element. This allows fast lookup and allows the order of specification to be preserved.


Field Summary
protected  Vector elements
           
protected  Hashtable index
           
 
Constructor Summary
IndexedVector()
          IndexedVector constructor comment.
IndexedVector(int size)
          IndexedVector constructor comment.
 
Method Summary
 void appendElement(Object key, Object value)
           
 Object elementAt(int i)
          Returns the element at the specified index.
 Enumeration elements()
           
 Object getElement(Object key)
           
 boolean removeElement(Object key)
          remove element referred to by key NOT value; return false if not found.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elements

protected Vector elements

index

protected Hashtable index
Constructor Detail

IndexedVector

public IndexedVector()
IndexedVector constructor comment.


IndexedVector

public IndexedVector(int size)
IndexedVector constructor comment.

Parameters:
size - int
Method Detail

appendElement

public void appendElement(Object key,
                          Object value)

elementAt

public Object elementAt(int i)
Returns the element at the specified index.

Throws:
ArrayIndexOutOfBoundsException - If an invalid index was given.

elements

public Enumeration elements()

getElement

public Object getElement(Object key)

removeElement

public boolean removeElement(Object key)
remove element referred to by key NOT value; return false if not found.


size

public int size()


Copyright 1999-2003 Oliver Zeigermann. All Rights Reserved.