org.antlr.misc
Class IntArrayList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList
org.antlr.misc.IntArrayList
- All Implemented Interfaces:
- Cloneable, Iterable, Collection, List
public class IntArrayList
- extends AbstractList
- implements 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
|
| Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
n
protected int n
elements
protected int[] elements
IntArrayList
public IntArrayList()
IntArrayList
public IntArrayList(int initialCapacity)
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 Object get(int i)
- Specified by:
get in interface List- Specified by:
get in class AbstractList
element
public int element(int i)
elements
public int[] elements()
size
public int size()
- Specified by:
size in interface Collection- Specified by:
size in interface List- Specified by:
size in class AbstractCollection
capacity
public int capacity()
equals
public boolean equals(Object o)
- Specified by:
equals in interface Collection- Specified by:
equals in interface List- Overrides:
equals in class AbstractList
clone
public Object clone()
throws CloneNotSupportedException
- Overrides:
clone in class Object
- Throws:
CloneNotSupportedException
toString
public String toString()
- Overrides:
toString in class AbstractCollection
Copyright © 2011. All Rights Reserved.