Class 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

    final class ImmutableSortedAsList<E>
    extends RegularImmutableAsList<E>
    implements SortedIterable<E>
    List returned by ImmutableSortedSet.asList() when the set isn't empty.
    • Method Detail

      • comparator

        public java.util.Comparator<? super E> comparator()
        Description copied from interface: SortedIterable
        Returns the Comparator by which the elements of this iterable are ordered, or Ordering.natural() if the elements are ordered by their natural ordering.
        Specified by:
        comparator in interface SortedIterable<E>
      • indexOf

        public int indexOf​(@CheckForNull
                           java.lang.Object target)
        Specified by:
        indexOf in interface java.util.List<E>
        Overrides:
        indexOf in class ImmutableList<E>
      • lastIndexOf

        public int lastIndexOf​(@CheckForNull
                               java.lang.Object target)
        Specified by:
        lastIndexOf in interface java.util.List<E>
        Overrides:
        lastIndexOf in class ImmutableList<E>
      • contains

        public boolean contains​(@CheckForNull
                                java.lang.Object target)
        Specified by:
        contains in interface java.util.Collection<E>
        Specified by:
        contains in interface java.util.List<E>
        Overrides:
        contains in class ImmutableAsList<E>
      • spliterator

        public java.util.Spliterator<E> spliterator()
        Specified by:
        spliterator in interface java.util.Collection<E>
        Specified by:
        spliterator in interface java.lang.Iterable<E>
        Specified by:
        spliterator in interface java.util.List<E>
        Overrides:
        spliterator in class ImmutableList<E>