org.antlr.misc
Class IntArrayList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList
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 |
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 |
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 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
Copyright © 2011. All Rights Reserved.