Top Description Fields Constructors Methods
org.antlr.runtime.misc

public Class IntArray

extends Object
Class Inheritance

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.

Field Summary

Modifier and TypeField and Description
public int[]
public static final int
protected int
p

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(int v)

public void
public void
ensureCapacity(int index)

public int
pop()

public void
push(int v)

public int
size()

This only tracks elements added via push/add.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
public int[] data
INITIAL_SIZEback to summary
public static final int INITIAL_SIZE
pback to summary
protected int p

Constructor Detail

IntArrayback to summary
public IntArray()

Method Detail

addback to summary
public void add(int v)
clearback to summary
public void clear()
ensureCapacityback to summary
public void ensureCapacity(int index)
popback to summary
public int pop()
pushback to summary
public void push(int v)
sizeback to summary
public int size()

This only tracks elements added via push/add.