org.antlr.stringtemplate.language
Class ArrayWrappedInList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by org.antlr.stringtemplate.language.ArrayWrappedInList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class ArrayWrappedInList
extends java.util.ArrayList

Turn an array into a List; subclass ArrayList for easy development, but it really doesn't use super stuff for anything. Ensure we create ArrayIterator for this List.

See Also:
Serialized Form

Field Summary
protected  java.lang.Object array
           
protected  int n
          Arrays are fixed size; precompute.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ArrayWrappedInList(java.lang.Object array)
           
 
Method Summary
 java.lang.Object get(int i)
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 int size()
           
 java.lang.Object[] toArray()
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, indexOf, lastIndexOf, remove, remove, removeRange, set, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

array

protected java.lang.Object array

n

protected int n
Arrays are fixed size; precompute.

Constructor Detail

ArrayWrappedInList

public ArrayWrappedInList(java.lang.Object array)
Method Detail

get

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

size

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

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.List
Overrides:
isEmpty in class java.util.ArrayList

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List
Overrides:
toArray in class java.util.ArrayList

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.List
Overrides:
iterator in class java.util.AbstractList