Module org.jhotdraw8.icollection
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
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 Summary
Methods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.jhotdraw8.icollection.readonly.ReadOnlyCollection
characteristics, contains, containsAll, isEmpty, iterator, size, stream, toArray, toArray
-
Method Details
-
getFirst
Gets the first element.- Returns:
- an element
- Throws:
NoSuchElementException- if the collection is empty
-
getLast
Gets the last element.- Returns:
- an element
- Throws:
NoSuchElementException- if the collection is empty
-
readOnlyReversed
@NonNull 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
Description copied from interface:ReadOnlyCollectionWraps this collection in the Collection interface - without copying.- Specified by:
asCollectionin interfaceReadOnlyCollection<E>- Returns:
- the wrapped collection
-