E - the type of the List's elements.public final class ImmutableList<E> extends AbstractList<E> implements RandomAccess, Serializable
List implementation. Accepts null
values.| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableList.Builder<E>
ImmutableList builder. |
modCount| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E e) |
void |
add(int index,
E element) |
boolean |
addAll(Collection<? extends E> c) |
boolean |
addAll(int index,
Collection<? extends E> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
static <E> List<E> |
copyOf(Collection<? extends E> c)
Creates a new
ImmutableList from the given Collection. |
static <E> List<E> |
copyOf(E[] values)
Creates a new
ImmutableList containing the given elements. |
static <E> List<E> |
copyOf(Iterable<? extends E> i)
Creates a new
ImmutableList from the given Iterable. |
static <E> List<E> |
copyOf(Iterator<? extends E> i)
Creates a new
ImmutableList from the given Iterator. |
E |
get(int index) |
int |
indexOf(Object o) |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int index) |
static <E> List<E> |
of(E... values)
Creates a new
ImmutableList containing the given elements. |
E |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
E |
set(int index,
E element) |
int |
size() |
List<E> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
equals, hashCode, removeRangetoStringpublic static <E> List<E> copyOf(Collection<? extends E> c)
ImmutableList from the given Collection.E - the type of the List's elements.c - the source Collection.ImmutableList.NullPointerException - if c is null.public static <E> List<E> copyOf(Iterable<? extends E> i)
ImmutableList from the given Iterable.E - the type of the List's elements.i - the source Iterable.ImmutableList.NullPointerException - if i is null.public static <E> List<E> copyOf(Iterator<? extends E> i)
ImmutableList from the given Iterator.E - the type of the List's elements.i - the source Iterator.ImmutableList.NullPointerException - if i is null.public static <E> List<E> copyOf(E[] values)
ImmutableList containing the given elements.E - the type of the List's elements.values - the List's elements.ImmutableList.NullPointerException - if values is null.public static <E> List<E> of(E... values)
ImmutableList containing the given elements.E - the type of the List's elements.values - the List's elements.ImmutableList.NullPointerException - if values is null.public int size()
size in interface Collection<E>size in interface List<E>size in class AbstractCollection<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface List<E>isEmpty in class AbstractCollection<E>public boolean contains(Object o)
contains in interface Collection<E>contains in interface List<E>contains in class AbstractCollection<E>public Object[] toArray()
toArray in interface Collection<E>toArray in interface List<E>toArray in class AbstractCollection<E>public <E> E[] toArray(E[] a)
toArray in interface Collection<E>toArray in interface List<E>toArray in class AbstractCollection<E>public boolean add(E e)
add in interface Collection<E>add in interface List<E>add in class AbstractList<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface List<E>remove in class AbstractCollection<E>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface List<E>containsAll in class AbstractCollection<E>public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface List<E>addAll in class AbstractCollection<E>public boolean addAll(int index,
Collection<? extends E> c)
public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface List<E>removeAll in class AbstractCollection<E>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>retainAll in interface List<E>retainAll in class AbstractCollection<E>public void clear()
clear in interface Collection<E>clear in interface List<E>clear in class AbstractList<E>public E get(int index)
public void add(int index,
E element)
public E remove(int index)
public int indexOf(Object o)
public int lastIndexOf(Object o)
lastIndexOf in interface List<E>lastIndexOf in class AbstractList<E>public ListIterator<E> listIterator()
listIterator in interface List<E>listIterator in class AbstractList<E>public ListIterator<E> listIterator(int index)
listIterator in interface List<E>listIterator in class AbstractList<E>Copyright © 2012–2015. All rights reserved.