Home | Download | News | Wiki | About ANTLR | Feedback | Support | Bugs


Latest version is 2.7.7.
Download now! »

Download
» Home
» Download
» News
»Using ANTLR
» Documentation
» Wiki
» FAQ
» Articles
» Grammars
» File Sharing
» Code API
» Tech Support
» Bug Tracking
»About ANTLR
» What is ANTLR
» Why use ANTLR
» Showcase
» Testimonials
» Getting Started
» Software License
» ANTLR WebLogs
» ANTLR Workshops
»StringTemplate
»TML
»PCCTS
»Feedback
»Credits
»Contact


Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)

Search



IndexedVector


antlr.collections.impl
Class IndexedVector

java.lang.Object
  extended byantlr.collections.impl.IndexedVector

public class IndexedVector
extends java.lang.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.


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

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(java.lang.Object key,
                          java.lang.Object value)

elementAt

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

Throws:
java.lang.ArrayIndexOutOfBoundsException - If an invalid index was given.

elements

public java.util.Enumeration elements()

getElement

public java.lang.Object getElement(java.lang.Object key)

removeElement

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


size

public int size()