org.elasticsearch.common.collect
Class BoundedArrayList<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by org.elasticsearch.common.collect.BoundedArrayList<E>
All Implemented Interfaces:
java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.RandomAccess

public class BoundedArrayList<E>
extends java.util.AbstractList<E>
implements java.util.RandomAccess

An array list that is based on an array and a size, only using the first size elements in the array.


Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
BoundedArrayList(E[] array, int size)
           
 
Method Summary
 boolean contains(java.lang.Object o)
           
 E get(int index)
           
 int indexOf(java.lang.Object o)
           
 E set(int index, E element)
           
 int size()
           
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, containsAll, isEmpty, remove, removeAll, retainAll
 

Constructor Detail

BoundedArrayList

public BoundedArrayList(E[] array,
                        int size)
Method Detail

size

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

toArray

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

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface java.util.Collection<E>
Specified by:
toArray in interface java.util.List<E>
Overrides:
toArray in class java.util.AbstractCollection<E>

get

public E get(int index)
Specified by:
get in interface java.util.List<E>
Specified by:
get in class java.util.AbstractList<E>

set

public E set(int index,
             E element)
Specified by:
set in interface java.util.List<E>
Overrides:
set in class java.util.AbstractList<E>

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List<E>
Overrides:
indexOf in class java.util.AbstractList<E>

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection<E>
Specified by:
contains in interface java.util.List<E>
Overrides:
contains in class java.util.AbstractCollection<E>