Interface ReadOnlySequencedCollection<E>

Type Parameters:
E - the element type
All Superinterfaces:
Iterable<E>, ReadOnlyCollection<E>
All Known Subinterfaces:
ImmutableList<E>, ImmutableNavigableSet<E>, ImmutableSequencedCollection<E>, ImmutableSequencedSet<E>, ImmutableSortedSet<E>, ReadOnlyList<E>, ReadOnlyNavigableSet<E>, ReadOnlySequencedSet<E>, ReadOnlySortedSet<E>
All Known Implementing Classes:
AbstractReadOnlyList, ChampVectorSet, MutableChampVectorSet, MutableListFacade, MutableRedBlackSet, MutableVectorList, ReadOnlyListFacade, ReadOnlyNavigableSetFacade, ReadOnlySequencedCollectionFacade, ReadOnlySequencedSetFacade, ReadOnlySortedSetFacade, RedBlackSet, VectorList

public interface ReadOnlySequencedCollection<E> extends ReadOnlyCollection<E>
A read-only interface to a sequenced collection. A sequenced collection has a well-defined encounter order, that supports operations at both ends, and that is reversible.
  • Method Details

    • getFirst

      default E getFirst()
      Gets the first element.
      Returns:
      an element
      Throws:
      NoSuchElementException - if the collection is empty
    • getLast

      default E getLast()
      Gets the last element.
      Returns:
      an element
      Throws:
      NoSuchElementException - if the collection is empty
    • readOnlyReversed

      ReadOnlySequencedCollection<E> readOnlyReversed()
      Returns a reversed-order view of this collection. Changes to the underlying collection are visible in the reversed view.
      Returns:
      a reversed-order view of this collection
    • asCollection

      default SequencedCollection<E> asCollection()
      Description copied from interface: ReadOnlyCollection
      Wraps this collection in the Collection interface - without copying.
      Specified by:
      asCollection in interface ReadOnlyCollection<E>
      Returns:
      the wrapped collection