Stay organized with collections Save and categorize content based on your preferences. SequencedSet
interface SequencedSet<E : Any!> : SequencedCollection<E>, MutableSet<E>
Known Direct Subclasses | LinkedHashSet | Hash table and linked list implementation of the Set interface, with well-defined encounter order. | | SortedSet | A Set that further provides a total ordering on its elements. | |
Known Indirect Subclasses |
A collection that is both a SequencedCollection and a Set. As such, it can be thought of either as a Set that also has a well-defined encounter order, or as a SequencedCollection that also has unique elements.
This interface has the same requirements on the equals and hashCode methods as defined by java.util.Set#equals and java.util.Set#hashCode. Thus, a Set and a SequencedSet will compare equals if and only if they have equal elements, irrespective of ordering.
SequencedSet defines the reversed method, which provides a reverse-ordered view of this set. The only difference from the SequencedCollection.reversed method is that the return type of SequencedSet.reversed is SequencedSet.
This class is a member of the Java Collections Framework.
Summary
| Public methods |
| abstract SequencedSet<E>! | Returns a reverse-ordered view of this collection. |
| Inherited functions |
From class SequencedCollection Unit | addFirst(e: E) Adds an element as the first element of this collection (optional operation). After this operation completes normally, the given element will be a member of this collection, and it will be the first element in encounter order. | Unit | addLast(e: E) Adds an element as the last element of this collection (optional operation). After this operation completes normally, the given element will be a member of this collection, and it will be the last element in encounter order. | E | getFirst() Gets the first element of this collection. | E | getLast() Gets the last element of this collection. | E | removeFirst() Removes and returns the first element of this collection (optional operation). | E | removeLast() Removes and returns the last element of this collection (optional operation). | |
Public methods
reversed
abstract fun reversed(): SequencedSet<E>!
Returns a reverse-ordered view of this collection. The encounter order of elements in the returned view is the inverse of the encounter order of elements in this collection. The reverse ordering affects all order-sensitive operations, including those on the view collections of the returned view. If the collection implementation permits modifications to this view, the modifications "write through" to the underlying collection. Changes to the underlying collection might or might not be visible in this reversed view, depending upon the implementation.
| Return |
SequencedSet<E>! | a reverse-ordered view of this collection, as a SequencedSet |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]