Skip to content
Buy me a coffee

SequencedSet

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

A set with a defined encounter order (LinkedHashSet, TreeSet). On an insertion-ordered set, addFirst and addLast move an element that is already present to that end.

E

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

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

Iterator<E, any, any>

SequencedCollection.[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

SequencedCollection.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

SequencedCollection.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

SequencedCollection.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

SequencedCollection.addLast


clear(): void

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

Removes all elements.

void

UnsupportedOperationException if this collection is unmodifiable

SequencedCollection.clear


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)

SequencedCollection.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

SequencedCollection.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

SequencedCollection.equals


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

SequencedCollection.forEach


getFirst(): E

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

Returns the first element.

E

NoSuchElementException if this collection is empty

SequencedCollection.getFirst


getLast(): E

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

Returns the last element.

E

NoSuchElementException if this collection is empty

SequencedCollection.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

SequencedCollection.hashCode


isEmpty(): boolean

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

Returns true if this collection has no elements.

boolean

SequencedCollection.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>

SequencedCollection.iterator


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>

SequencedCollection.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

SequencedCollection.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

SequencedCollection.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

SequencedCollection.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

SequencedCollection.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

SequencedCollection.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

SequencedCollection.retainAll


reversed(): SequencedSet<E>

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

Returns a live reverse-ordered view: changes through either side are visible in the other.

SequencedSet<E>

SequencedCollection.reversed


size(): number

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

Returns the number of elements.

number

SequencedCollection.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>

SequencedCollection.spliterator


stream(): Stream<E>

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

Returns a sequential stream over this collection.

Stream<E>

SequencedCollection.stream


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[]

SequencedCollection.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

SequencedCollection.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

SequencedCollection.toString