SequencedSet

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 SequencedCollection.html#encounter, or as a SequencedCollection that also has unique elements.

This interface has the same requirements on the equals and hashCode methods as defined by Set.equals and 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 Collection.html#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 {@docRoot}/java.base/java/util/package-summary.html#CollectionsFramework.

Since

21

Parameters

the type of elements in this sequenced set

Inheritors

Properties

Link copied to clipboard
open val first: E?
Link copied to clipboard
open val last: E?
Link copied to clipboard
abstract val size: Int

Functions

Link copied to clipboard
abstract fun add(element: E): Boolean
Link copied to clipboard
abstract fun addAll(elements: Collection<E>): Boolean
Link copied to clipboard
open fun 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.

Link copied to clipboard
open fun 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.

Link copied to clipboard
abstract fun clear()
Link copied to clipboard
abstract operator fun contains(element: E): Boolean
Link copied to clipboard
abstract fun containsAll(elements: Collection<E>): Boolean
Link copied to clipboard
abstract fun isEmpty(): Boolean
Link copied to clipboard
abstract operator override fun iterator(): MutableIterator<E>
Link copied to clipboard
abstract fun remove(element: E): Boolean
Link copied to clipboard
Link copied to clipboard
open fun removeFirst(): E?

Removes and returns the first element of this collection (optional operation).

Link copied to clipboard
open fun removeLast(): E?

Removes and returns the last element of this collection (optional operation).

Link copied to clipboard
Link copied to clipboard
abstract override fun reversed(): SequencedSet<E>

{@inheritDoc}