org.antlr.misc
Class IntArrayList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by org.antlr.misc.IntArrayList
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List

public class IntArrayList
extends java.util.AbstractList
implements java.lang.Cloneable

An ArrayList based upon int members. Not quite a real implementation of a modifiable list as I don't do, for example, add(index,element). TODO: unused?


Field Summary
protected  int[] elements
           
protected  int n
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
IntArrayList()
           
IntArrayList(int initialCapacity)
           
 
Method Summary
 boolean add(int o)
           
 int capacity()
           
 java.lang.Object clone()
           
 boolean contains(int v)
           
 int element(int i)
           
 int[] elements()
           
 void ensureCapacity(int newCapacity)
           
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(int i)
           
protected  void grow()
           
 int set(int i, int newValue)
          Set the ith element.
 void setSize(int newSize)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

n

protected int n

elements

protected int[] elements
Constructor Detail

IntArrayList

public IntArrayList()

IntArrayList

public IntArrayList(int initialCapacity)
Method Detail

set

public int set(int i,
               int newValue)
Set the ith element. Like ArrayList, this does NOT affect size.


add

public boolean add(int o)

setSize

public void setSize(int newSize)

grow

protected void grow()

contains

public boolean contains(int v)

ensureCapacity

public void ensureCapacity(int newCapacity)

get

public java.lang.Object get(int i)
Specified by:
get in interface java.util.List
Specified by:
get in class java.util.AbstractList

element

public int element(int i)

elements

public int[] elements()

size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List
Specified by:
size in class java.util.AbstractCollection

capacity

public int capacity()

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.List
Overrides:
equals in class java.util.AbstractList

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

toString

public java.lang.String toString()
Overrides:
toString in class java.util.AbstractCollection