Skip to content
Buy me a coffee

SortedSet

Defined in: src/interfaces/Set.ts:29

A set kept in ascending order by natural ordering or a comparator. The comparator (or compareTo) alone decides whether two elements are the same. addFirst/addLast throw UnsupportedOperationException. With natural ordering, null elements throw NullPointerException and elements with no natural order throw ClassCastException. Range views are live and reject adding an element outside their range with IllegalArgumentException.

E

[iterator](): Iterator<E, any, any>

Defined in: site/node_modules/typescript/lib/lib.es2015.iterable.d.ts:47

Iterator<E, any, any>

SequencedSet.[iterator]


add(e): boolean

Defined in: src/interfaces/Collection.ts:54

Ensures this collection contains e.

E

boolean

true if the collection changed (a set returns false for a duplicate)

UnsupportedOperationException if this collection is unmodifiable

NullPointerException if e is null and this collection rejects null

IllegalArgumentException if some property of e prevents adding it (for example a key outside a sorted view’s range)

IllegalStateException if a capacity-bounded queue is full

SequencedSet.add


addAll(c): boolean

Defined in: src/interfaces/Collection.ts:73

Adds every element of c, in c’s iteration order. c is copied first, so addAll(this) terminates.

Collection<E>

boolean

true if this collection changed

NullPointerException if c is null, or contains null and this collection rejects null

UnsupportedOperationException if this collection is unmodifiable

SequencedSet.addAll


addFirst(e): void

Defined in: src/interfaces/Collection.ts:133

Adds e as the first element (for a set that already holds it, moves it to the front).

E

void

UnsupportedOperationException if this collection is unmodifiable or sorted

NullPointerException if e is null and this collection rejects null

SequencedSet.addFirst


addLast(e): void

Defined in: src/interfaces/Collection.ts:139

Adds e as the last element (for a set that already holds it, moves it to the end).

E

void

UnsupportedOperationException if this collection is unmodifiable or sorted

NullPointerException if e is null and this collection rejects null

SequencedSet.addLast


clear(): void

Defined in: src/interfaces/Collection.ts:99

Removes all elements.

void

UnsupportedOperationException if this collection is unmodifiable

SequencedSet.clear


comparator(): Comparator<E> | null

Defined in: src/interfaces/Set.ts:31

Returns the comparator that orders this set, or null when it uses natural ordering.

Comparator<E> | null


contains(o): boolean

Defined in: src/interfaces/Collection.ts:37

Returns true if this collection contains an element equal to o (by Objects.equals).

unknown

boolean

NullPointerException if o is null and this collection rejects null (for example the immutable collections and sorted collections with natural ordering)

SequencedSet.contains


containsAll(c): boolean

Defined in: src/interfaces/Collection.ts:66

Returns true if this collection contains every element of c.

Collection<unknown>

boolean

NullPointerException if c is null

SequencedSet.containsAll


equals(o): boolean

Defined in: src/interfaces/Collection.ts:105

Compares this collection with o for equality. A List equals any other List with the same elements in the same order; a Set equals any other Set with the same elements; other collections (queues, deques, values() views) use identity.

unknown

boolean

SequencedSet.equals


first(): E

Defined in: src/interfaces/Set.ts:36

Returns the lowest element.

E

NoSuchElementException if this set is empty


forEach(action): void

Defined in: src/interfaces/Collection.ts:27

Calls action for each element, in iteration order.

(e) => void

void

NullPointerException if action is null

ConcurrentModificationException if action structurally modifies this collection

SequencedSet.forEach


getFirst(): E

Defined in: src/interfaces/Collection.ts:144

Returns the first element.

E

NoSuchElementException if this collection is empty

SequencedSet.getFirst


getLast(): E

Defined in: src/interfaces/Collection.ts:149

Returns the last element.

E

NoSuchElementException if this collection is empty

SequencedSet.getLast


hashCode(): number

Defined in: src/interfaces/Collection.ts:110

Returns a hash code consistent with equals. A list hashes as h = 31 * h + hash(e) starting from 1, a set as the sum of its element hashes (both in 32-bit arithmetic); other collections use an identity hash.

number

SequencedSet.hashCode


headSet(toElement): SortedSet<E>

Defined in: src/interfaces/Set.ts:47

Returns a live view of the elements strictly less than toElement.

E

SortedSet<E>

NullPointerException if toElement is null and this set rejects null

IllegalArgumentException if this set is itself a range view and toElement is outside its range


isEmpty(): boolean

Defined in: src/interfaces/Collection.ts:31

Returns true if this collection has no elements.

boolean

SequencedSet.isEmpty


iterator(): Iterator<E>

Defined in: src/interfaces/Collection.ts:21

Returns a fail-fast iterator over the elements, in this collection’s encounter order (if it has one). Its remove() throws UnsupportedOperationException on an unmodifiable collection.

Iterator<E>

SequencedSet.iterator


last(): E

Defined in: src/interfaces/Set.ts:41

Returns the highest element.

E

NoSuchElementException if this set is empty


parallelStream(): Stream<E>

Defined in: src/interfaces/Collection.ts:118

Returns a stream flagged as parallel; it is evaluated sequentially (JS is single-threaded).

Stream<E>

SequencedSet.parallelStream


remove(o): boolean

Defined in: src/interfaces/Collection.ts:61

Removes one element equal to o, if present.

unknown

boolean

true if an element was removed

UnsupportedOperationException if this collection is unmodifiable

NullPointerException if o is null and this collection rejects null

SequencedSet.remove


removeAll(c): boolean

Defined in: src/interfaces/Collection.ts:80

Removes every element that is also contained in c.

Collection<unknown>

boolean

true if this collection changed

NullPointerException if c is null

UnsupportedOperationException if this collection is unmodifiable

SequencedSet.removeAll


removeFirst(): E

Defined in: src/interfaces/Collection.ts:155

Removes and returns the first element.

E

NoSuchElementException if this collection is empty

UnsupportedOperationException if this collection is unmodifiable

SequencedSet.removeFirst


removeIf(filter): boolean

Defined in: src/interfaces/Collection.ts:87

Removes every element for which filter returns true.

(e) => boolean

boolean

true if any element was removed

NullPointerException if filter is null

UnsupportedOperationException if this collection is unmodifiable and an element matches

SequencedSet.removeIf


removeLast(): E

Defined in: src/interfaces/Collection.ts:161

Removes and returns the last element.

E

NoSuchElementException if this collection is empty

UnsupportedOperationException if this collection is unmodifiable

SequencedSet.removeLast


retainAll(c): boolean

Defined in: src/interfaces/Collection.ts:94

Keeps only the elements that are also contained in c, removing all others.

Collection<unknown>

boolean

true if this collection changed

NullPointerException if c is null

UnsupportedOperationException if this collection is unmodifiable

SequencedSet.retainAll


reversed(): SortedSet<E>

Defined in: src/interfaces/Set.ts:62

Returns a live descending view: changes through either side are visible in the other.

SortedSet<E>

SequencedSet.reversed


size(): number

Defined in: src/interfaces/Collection.ts:29

Returns the number of elements.

number

SequencedSet.size


spliterator(): Spliterator<E>

Defined in: src/interfaces/Collection.ts:114

Returns a spliterator over the elements, used to build streams. Fail-fast like the iterator.

Spliterator<E>

SequencedSet.spliterator


stream(): Stream<E>

Defined in: src/interfaces/Collection.ts:116

Returns a sequential stream over this collection.

Stream<E>

SequencedSet.stream


subSet(fromElement, toElement): SortedSet<E>

Defined in: src/interfaces/Set.ts:60

Returns a live view of the elements from fromElement (inclusive) to toElement (exclusive).

E

E

SortedSet<E>

IllegalArgumentException if fromElement is greater than toElement, or either is outside this view’s range

NullPointerException if either bound is null and this set rejects null


tailSet(fromElement): SortedSet<E>

Defined in: src/interfaces/Set.ts:53

Returns a live view of the elements greater than or equal to fromElement.

E

SortedSet<E>

NullPointerException if fromElement is null and this set rejects null

IllegalArgumentException if this set is itself a range view and fromElement is outside its range


toArray(): E[]

Defined in: src/interfaces/Collection.ts:39

Returns a new array with all elements, in iteration order. Changing the array does not affect this collection.

E[]

SequencedSet.toArray

toArray<A>(generator): A

Defined in: src/interfaces/Collection.ts:44

Fills an array created by generator(size()), in iteration order, and returns it; e.g. n => new Float64Array(n).

A extends WritableArrayLike<E>

(length) => A

creates the target array for a given length

A

SequencedSet.toArray


toString(): string

Defined in: src/interfaces/Collection.ts:112

Returns the elements in iteration order as [a, b, c]; an element that is this collection prints as (this Collection).

string

SequencedSet.toString