public class ImmutableList<T> extends ImmutableCollection<T> implements List<T>, RandomAccess
array, emptyArray, length| Constructor and Description |
|---|
ImmutableList(T[] array) |
ImmutableList(T[] array,
int length) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
T element) |
boolean |
addAll(int index,
Collection<? extends T> c) |
static <TT> ImmutableList<TT> |
emptyList() |
boolean |
equals(Object other)
Compares the specified object with this list for equality.
|
T |
get(int index) |
int |
hashCode()
Returns the hash code value for this list.
|
int |
indexOf(Object o) |
int |
lastIndexOf(Object o) |
ListIterator<T> |
listIterator() |
ListIterator<T> |
listIterator(int index) |
static <TT> ImmutableList<TT> |
listOf(TT[] array) |
static <TT> ImmutableList<TT> |
listOf(TT[] array,
int length) |
T |
remove(int index) |
T |
set(int index,
T element) |
ImmutableList<T> |
subList(int fromIndex,
int toIndex) |
contains, contains, iterator, toArray, toArrayadd, addAll, containsAll, remove, removeAll, retainAll, toStringclear, isEmpty, sizeclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, replaceAll, retainAll, size, sort, spliterator, toArray, toArrayparallelStream, removeIf, streampublic ImmutableList(T[] array, int length)
public ImmutableList(T[] array)
public int lastIndexOf(Object o)
lastIndexOf in interface List<T>public ListIterator<T> listIterator()
listIterator in interface List<T>public ListIterator<T> listIterator(int index)
listIterator in interface List<T>public ImmutableList<T> subList(int fromIndex, int toIndex)
public boolean equals(Object other)
true if and only if the specified
object is also a list, both lists have the same size, and all corresponding pairs of elements in the two lists
are equal. (Two elements e1 and e2 are equal if
(e1 == null ? e2 == null : e1.equals(e2)).) In other words, two lists are defined to be equal if they
contain the same elements in the same order. This definition ensures that the equals method works properly
across different implementations of the List interface.public int hashCode()
This implementation uses exactly the code that is used to define the list hash function in the documentation
for the List.hashCode() method.
public static <TT> ImmutableList<TT> emptyList()
public static <TT> ImmutableList<TT> listOf(TT[] array)
public static <TT> ImmutableList<TT> listOf(TT[] array, int length)
public boolean addAll(int index,
Collection<? extends T> c)
Copyright © 2021. All rights reserved.