private static class ImmutableList.ReverseImmutableList<E> extends ImmutableList<E>
ImmutableList.Builder<E>, ImmutableList.SerializedForm, ImmutableList.SubList| Modifier and Type | Field and Description |
|---|---|
private ImmutableList<E> |
forwardList |
SPLITERATOR_CHARACTERISTICS| Constructor and Description |
|---|
ReverseImmutableList(ImmutableList<E> backingList) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(java.lang.Object object) |
E |
get(int index) |
int |
indexOf(java.lang.Object object) |
(package private) boolean |
isPartialView()
Returns
true if this immutable collection's implementation contains references to
user-created objects that aren't accessible via this collection's methods. |
int |
lastIndexOf(java.lang.Object object) |
ImmutableList<E> |
reverse()
Returns a view of this immutable list in reverse order.
|
private int |
reverseIndex(int index) |
private int |
reversePosition(int index) |
int |
size() |
ImmutableList<E> |
subList(int fromIndex,
int toIndex)
Returns an immutable list of the elements between the specified
fromIndex, inclusive,
and toIndex, exclusive. |
add, addAll, asImmutableList, asImmutableList, asList, builder, builderWithExpectedSize, copyIntoArray, copyOf, copyOf, copyOf, copyOf, equals, forEach, hashCode, iterator, listIterator, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, of, remove, replaceAll, set, sort, sortedCopyOf, sortedCopyOf, spliterator, subListUnchecked, toImmutableList, writeReplaceadd, addAll, clear, internalArray, internalArrayEnd, internalArrayStart, remove, removeAll, removeIf, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitprivate final transient ImmutableList<E> forwardList
ReverseImmutableList(ImmutableList<E> backingList)
private int reverseIndex(int index)
private int reversePosition(int index)
public ImmutableList<E> reverse()
ImmutableListImmutableList.of(1,
2, 3).reverse() is equivalent to ImmutableList.of(3, 2, 1).reverse in class ImmutableList<E>public boolean contains(@CheckForNull
java.lang.Object object)
contains in interface java.util.Collection<E>contains in interface java.util.List<E>contains in class ImmutableList<E>public int indexOf(@CheckForNull
java.lang.Object object)
indexOf in interface java.util.List<E>indexOf in class ImmutableList<E>public int lastIndexOf(@CheckForNull
java.lang.Object object)
lastIndexOf in interface java.util.List<E>lastIndexOf in class ImmutableList<E>public ImmutableList<E> subList(int fromIndex, int toIndex)
ImmutableListfromIndex, inclusive,
and toIndex, exclusive. (If fromIndex and toIndex are equal, the empty
immutable list is returned.)subList in interface java.util.List<E>subList in class ImmutableList<E>public E get(int index)
public int size()
boolean isPartialView()
ImmutableCollectiontrue if this immutable collection's implementation contains references to
user-created objects that aren't accessible via this collection's methods. This is generally
used to determine whether copyOf implementations should make an explicit copy to avoid
memory leaks.isPartialView in class ImmutableCollection<E>