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 |
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.
| 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.
final int org.antlr.runtime.misc.IntArray.INITIAL_SIZE = 10 [static] |
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.
1.5.5