org.antlr.runtime.misc.IntArray Class Reference

List of all members.

Public Member Functions

void add (int v)
void push (int v)
int pop ()
int size ()
void clear ()
void ensureCapacity (int index)

Public Attributes

int[] data

Static Public Attributes

static final int INITIAL_SIZE = 10

Protected Attributes

int p = -1


Detailed Description

A dynamic array that uses int not Integer objects. In principle this is more efficient in time, but certainly in space.

This is simple enough that you can access the data array directly, but make sure that you append elements only with add() so that you get dynamic sizing. Make sure to call ensureCapacity() when you are manually adding new elements.

Doesn't impl List because it doesn't return objects and I mean this really as just an array not a List per se. Manipulate the elements at will. This has stack methods too.

When runtime can be 1.5, I'll make this generic.

Definition at line 44 of file IntArray.java.


Member Function Documentation

void org.antlr.runtime.misc.IntArray.add ( int  v  ) 

Definition at line 49 of file IntArray.java.

void org.antlr.runtime.misc.IntArray.push ( int  v  ) 

Definition at line 54 of file IntArray.java.

int org.antlr.runtime.misc.IntArray.pop (  ) 

Definition at line 58 of file IntArray.java.

int org.antlr.runtime.misc.IntArray.size (  ) 

This only tracks elements added via push/add.

Definition at line 65 of file IntArray.java.

void org.antlr.runtime.misc.IntArray.clear (  ) 

Definition at line 69 of file IntArray.java.

void org.antlr.runtime.misc.IntArray.ensureCapacity ( int  index  ) 

Definition at line 73 of file IntArray.java.


Member Data Documentation

Definition at line 45 of file IntArray.java.

Definition at line 46 of file IntArray.java.

int org.antlr.runtime.misc.IntArray.p = -1 [protected]

Definition at line 47 of file IntArray.java.


The documentation for this class was generated from the following file:

Generated on Tue Aug 12 11:41:57 2008 for ANTLR API by  doxygen 1.5.5