public final class ImmutableList<E>
extends java.util.AbstractCollection<E>
implements java.util.List<E>
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e)
Deprecated.
Unsupported operation.
|
void |
add(int index,
E element)
Deprecated.
Unsupported operation.
|
boolean |
addAll(java.util.Collection<? extends E> newElements)
Deprecated.
Unsupported operation.
|
boolean |
addAll(int index,
java.util.Collection<? extends E> newElements)
Deprecated.
Unsupported operation.
|
void |
clear()
Deprecated.
Unsupported operation.
|
boolean |
contains(java.lang.Object o) |
static <E> ImmutableList<E> |
copyOf(java.util.Collection<? extends E> list) |
static <E> ImmutableList<E> |
copyOf(E... a) |
static <E> ImmutableList<E> |
empty() |
boolean |
equals(java.lang.Object obj) |
E |
get(int index) |
int |
hashCode() |
int |
indexOf(java.lang.Object o) |
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<E> |
listIterator() |
java.util.ListIterator<E> |
listIterator(int index) |
static <E> ImmutableList<E> |
of(E... a) |
static <E> ImmutableList<E> |
of(java.util.List<? extends E> list) |
E |
remove(int index)
Deprecated.
Unsupported operation.
|
boolean |
remove(java.lang.Object object)
Deprecated.
Unsupported operation.
|
boolean |
removeAll(java.util.Collection<?> oldElements)
Deprecated.
Unsupported operation.
|
boolean |
removeIf(java.util.function.Predicate<? super E> filter)
Deprecated.
Unsupported operation.
|
void |
replaceAll(java.util.function.UnaryOperator<E> operator)
Deprecated.
Unsupported operation.
|
boolean |
retainAll(java.util.Collection<?> elementsToKeep)
Deprecated.
Unsupported operation.
|
E |
set(int index,
E element)
Deprecated.
Unsupported operation.
|
int |
size() |
void |
sort(java.util.Comparator<? super E> c)
Deprecated.
Unsupported operation.
|
Stream<E> |
streamm() |
java.util.List<E> |
subList(int fromIndex,
int toIndex) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
java.lang.String |
toString() |
public static <E> ImmutableList<E> empty()
@SafeVarargs public static <E> ImmutableList<E> of(E... a)
a
- the elements in this array
are shared by the returned ImmutableList.public static <E> ImmutableList<E> of(java.util.List<? extends E> list)
list
- the elements in this list
are shared by the returned ImmutableList.@SafeVarargs public static <E> ImmutableList<E> copyOf(E... a)
public static <E> ImmutableList<E> copyOf(java.util.Collection<? extends E> list)
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<E>
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<E>
public java.util.ListIterator<E> listIterator()
listIterator
in interface java.util.List<E>
public java.util.ListIterator<E> listIterator(int index)
listIterator
in interface java.util.List<E>
public java.util.List<E> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<E>
@Deprecated public final boolean addAll(int index, java.util.Collection<? extends E> newElements)
addAll
in interface java.util.List<E>
@Deprecated public final E set(int index, E element)
set
in interface java.util.List<E>
@Deprecated public final void add(int index, E element)
add
in interface java.util.List<E>
@Deprecated public final E remove(int index)
remove
in interface java.util.List<E>
@Deprecated public final void replaceAll(java.util.function.UnaryOperator<E> operator)
replaceAll
in interface java.util.List<E>
@Deprecated public final void sort(java.util.Comparator<? super E> c)
sort
in interface java.util.List<E>
@Deprecated public final boolean add(E e)
add
in interface java.util.Collection<E>
add
in class java.util.AbstractCollection<E>
@Deprecated public final boolean addAll(java.util.Collection<? extends E> newElements)
addAll
in interface java.util.Collection<E>
addAll
in class java.util.AbstractCollection<E>
@Deprecated public final boolean remove(java.lang.Object object)
remove
in interface java.util.Collection<E>
remove
in class java.util.AbstractCollection<E>
@Deprecated public boolean removeIf(java.util.function.Predicate<? super E> filter)
@Deprecated public final boolean removeAll(java.util.Collection<?> oldElements)
removeAll
in interface java.util.Collection<E>
removeAll
in class java.util.AbstractCollection<E>
@Deprecated public final boolean retainAll(java.util.Collection<?> elementsToKeep)
retainAll
in interface java.util.Collection<E>
retainAll
in class java.util.AbstractCollection<E>
@Deprecated public final void clear()
clear
in interface java.util.Collection<E>
clear
in class java.util.AbstractCollection<E>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<E>
contains
in class java.util.AbstractCollection<E>
public java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
iterator
in class java.util.AbstractCollection<E>
public int size()
size
in interface java.util.Collection<E>
size
in class java.util.AbstractCollection<E>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<E>
toArray
in class java.util.AbstractCollection<E>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<E>
toArray
in class java.util.AbstractCollection<E>
public Stream<E> streamm()
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Collection<E>
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Collection<E>
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.util.AbstractCollection<E>