public class ImmutableArrayList<E>
extends java.util.ArrayList<E>
Constructor and Description |
---|
ImmutableArrayList(java.util.Collection<? extends E> c)
Constructs a list containing the elements of the specified
collection, in the order they are returned by the collection's
iterator.
|
ImmutableArrayList(E[] a)
Constructs a list containing the elements of the specified array.
|
ImmutableArrayList(E[] a,
int fromIndex,
int toIndex)
Constructs a list containing the range of elements of the specified array.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E o) |
void |
add(int index,
E element) |
boolean |
addAll(java.util.Collection<? extends E> c) |
boolean |
addAll(int index,
java.util.Collection<? extends E> c) |
void |
clear() |
void |
ensureCapacity(int minCapacity) |
E |
remove(int index) |
boolean |
remove(java.lang.Object o) |
protected void |
removeRange(int fromIndex,
int toIndex) |
E |
set(int index,
E element) |
void |
trimToSize() |
ImmutableArrayList<E> |
with(E[] a) |
clone, contains, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeAll, retainAll, size, subList, toArray, toArray
public ImmutableArrayList(java.util.Collection<? extends E> c)
c
- the collection whose elements are to be placed into this list.java.lang.NullPointerException
- if the specified collection is null.public ImmutableArrayList(E[] a)
a
- the array whose elements are to be placed into this list.java.lang.NullPointerException
- if the specified array is null.public ImmutableArrayList(E[] a, int fromIndex, int toIndex)
a
- the array whose elements are to be placed into this list.fromIndex
- toIndex
- java.lang.NullPointerException
- if the specified array is null.public ImmutableArrayList<E> with(E[] a)
public void trimToSize()
trimToSize
in class java.util.ArrayList<E>
public void ensureCapacity(int minCapacity)
ensureCapacity
in class java.util.ArrayList<E>
public boolean add(E o)
public void add(int index, E element)
public E remove(int index)
public boolean remove(java.lang.Object o)
public void clear()
public boolean addAll(java.util.Collection<? extends E> c)
public boolean addAll(int index, java.util.Collection<? extends E> c)
protected void removeRange(int fromIndex, int toIndex)
removeRange
in class java.util.ArrayList<E>