org.elasticsearch.common.collect
Class BoundedArrayList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
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.
| Fields inherited from class java.util.AbstractList |
modCount |
| 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 |
BoundedArrayList
public BoundedArrayList(E[] array,
int size)
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>