Package com.google.common.collect
Class ImmutableSortedAsList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- com.google.common.collect.ImmutableCollection<E>
-
- com.google.common.collect.ImmutableList<E>
-
- com.google.common.collect.ImmutableAsList<E>
-
- com.google.common.collect.RegularImmutableAsList<E>
-
- com.google.common.collect.ImmutableSortedAsList<E>
-
- All Implemented Interfaces:
SortedIterable<E>
,java.io.Serializable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
,java.util.RandomAccess
@GwtCompatible(emulated=true) final class ImmutableSortedAsList<E> extends RegularImmutableAsList<E> implements SortedIterable<E>
List returned byImmutableSortedSet.asList()
when the set isn't empty.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.collect.ImmutableAsList
ImmutableAsList.SerializedForm
-
Nested classes/interfaces inherited from class com.google.common.collect.ImmutableList
ImmutableList.Builder<E>, ImmutableList.SubList
-
-
Field Summary
-
Fields inherited from class com.google.common.collect.ImmutableCollection
SPLITERATOR_CHARACTERISTICS
-
-
Constructor Summary
Constructors Constructor Description ImmutableSortedAsList(ImmutableSortedSet<E> backingSet, ImmutableList<E> backingList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Comparator<? super E>
comparator()
Returns theComparator
by which the elements of this iterable are ordered, orOrdering.natural()
if the elements are ordered by their natural ordering.boolean
contains(java.lang.Object target)
(package private) ImmutableSortedSet<E>
delegateCollection()
int
indexOf(java.lang.Object target)
int
lastIndexOf(java.lang.Object target)
java.util.Spliterator<E>
spliterator()
(package private) ImmutableList<E>
subListUnchecked(int fromIndex, int toIndex)
Called by the default implementation ofImmutableList.subList(int, int)
whentoIndex - fromIndex > 1
, after index validation has already been performed.-
Methods inherited from class com.google.common.collect.RegularImmutableAsList
copyIntoArray, delegateList, forEach, get, internalArray, internalArrayEnd, internalArrayStart, listIterator
-
Methods inherited from class com.google.common.collect.ImmutableAsList
isEmpty, isPartialView, size, writeReplace
-
Methods inherited from class com.google.common.collect.ImmutableList
add, addAll, asImmutableList, asImmutableList, asList, builder, builderWithExpectedSize, copyOf, copyOf, copyOf, copyOf, equals, hashCode, iterator, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, of, remove, replaceAll, reverse, set, sort, sortedCopyOf, sortedCopyOf, subList, toImmutableList
-
Methods inherited from class com.google.common.collect.ImmutableCollection
add, addAll, clear, remove, removeAll, removeIf, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.List
add, addAll, clear, containsAll, remove, removeAll, retainAll, toArray, toArray
-
Methods inherited from interface com.google.common.collect.SortedIterable
iterator
-
-
-
-
Constructor Detail
-
ImmutableSortedAsList
ImmutableSortedAsList(ImmutableSortedSet<E> backingSet, ImmutableList<E> backingList)
-
-
Method Detail
-
delegateCollection
ImmutableSortedSet<E> delegateCollection()
- Overrides:
delegateCollection
in classRegularImmutableAsList<E>
-
comparator
public java.util.Comparator<? super E> comparator()
Description copied from interface:SortedIterable
Returns theComparator
by which the elements of this iterable are ordered, orOrdering.natural()
if the elements are ordered by their natural ordering.- Specified by:
comparator
in interfaceSortedIterable<E>
-
indexOf
@GwtIncompatible public int indexOf(java.lang.Object target)
- Specified by:
indexOf
in interfacejava.util.List<E>
- Overrides:
indexOf
in classImmutableList<E>
-
lastIndexOf
@GwtIncompatible public int lastIndexOf(java.lang.Object target)
- Specified by:
lastIndexOf
in interfacejava.util.List<E>
- Overrides:
lastIndexOf
in classImmutableList<E>
-
contains
public boolean contains(java.lang.Object target)
- Specified by:
contains
in interfacejava.util.Collection<E>
- Specified by:
contains
in interfacejava.util.List<E>
- Overrides:
contains
in classImmutableAsList<E>
-
subListUnchecked
@GwtIncompatible ImmutableList<E> subListUnchecked(int fromIndex, int toIndex)
Description copied from class:ImmutableList
Called by the default implementation ofImmutableList.subList(int, int)
whentoIndex - fromIndex > 1
, after index validation has already been performed.- Overrides:
subListUnchecked
in classImmutableList<E>
-
spliterator
public java.util.Spliterator<E> spliterator()
- Specified by:
spliterator
in interfacejava.util.Collection<E>
- Specified by:
spliterator
in interfacejava.lang.Iterable<E>
- Specified by:
spliterator
in interfacejava.util.List<E>
- Overrides:
spliterator
in classImmutableList<E>
-
-