Skip to main content

abstract class SortedSetNode<T>

undocumented

Implements: SortedSet.NonEmpty<T>

Extended by: SortedSetInner<T>, SortedSetLeaf<T>

Type parameters

NameDescription
Tundocumented

Properties

_NonEmptyType

undocumented

Definition

_NonEmptyType: SortedSetNode<T>;

context

undocumented

Definition

abstract get context(): SortedSetContext<T>;

Overrides

RSetBase.context

isEmpty

Returns false since this collection is known to be non-empty

Definition

readonly isEmpty: false;

example
HashSet.of(1, 2, 3).isEmpty   // => false

Overrides

VariantSetBase.isEmptyNonEmpty.isEmpty

size

undocumented

Definition

abstract get size(): number;

Overrides

VariantSetBase.size

Methods

[Symbol.iterator]

Returns a FastIterator instance used to iterate over the values of this Iterable.

Definition

[Symbol.iterator](): FastIterator<T>;

Overrides

FastIterable.[Symbol.iterator]

add

undocumented

Definition

add(value: T): SortedSet.NonEmpty<T>;

Parameters

NameTypeDescription
valueT

Overrides

NonEmpty.add

addAll

undocumented

Definition

addAll(values: StreamSource<T>): SortedSet.NonEmpty<T>;

Parameters

NameTypeDescription
valuesStreamSource<T>

Overrides

NonEmpty.addAll

addInternal

undocumented

Definition

abstract addInternal(value: T): SortedSetNode<T>;

Parameters

NameTypeDescription
valueT

asNormal

undocumented

Definition

asNormal(): this;

Overrides

NonEmpty.asNormal

assumeNonEmpty

Returns a self reference since this collection is known to be non-empty.

Definition

assumeNonEmpty(): this;

example
const m = HashSet.of(1, 2, 3);
m === m.assumeNonEmpty() // => true

Overrides

VariantSetBase.assumeNonEmpty, NonEmpty.assumeNonEmpty

difference

undocumented

Definition

difference(other: StreamSource<T>): SortedSet<T>;

Parameters

NameTypeDescription
otherStreamSource<T>

Overrides

VariantSetBase.difference

drop

undocumented

Definition

drop(amount: number): SortedSet<T>;

Parameters

NameTypeDescription
amountnumber

Overrides

SortedSet.drop

filter

undocumented

Definition

filter(pred: (value: T, index: number, halt: () => void) => boolean, options?: {
    negate?: boolean | undefined;
  }): any;

Parameters

NameTypeDescription
pred(value: T, index: number, halt: () => void) => boolean
options{
    negate?: boolean | undefined;
  }

Overrides

VariantSetBase.filter

forEach

undocumented

Definition

abstract forEach(f: (value: T, index: number, halt: () => void) => void, options?: {
    state?: TraverseState;
  }): void;

Parameters

NameTypeDescription
f(value: T, index: number, halt: () => void) => void
options{
    state?: TraverseState;
  }

Overrides

VariantSetBase.forEach

getAtIndex

Returns the value at the given index of the value sort order of the SortedSet, or a fallback value (default: undefined) if the index is out of bounds.

Definitions

getAtIndex(index: number): T | undefined;

getAtIndex<O>(index: number, otherwise: OptLazy<O>): T | O;

Parameters

NameTypeDescription
indexnumberthe index in the key sort order
note

negative index values will retrieve the values from the end of the sort order, e.g. -1 is the last value

example
const m = SortedSet.of('b', 'd', 'a', 'c').asNormal();
console.log(m.getAtIndex(1))
// => 'b'
console.log(m.getAtIndex(-1))
// => 'd'
console.log(m.getAtIndex(10))
// => undefined
console.log(m.getAtIndex(10, 'q'))
// => 'q'

Overrides

SortedSet.getAtIndex

getInsertIndexOf

undocumented

Definition

abstract getInsertIndexOf(value: T): number;

Parameters

NameTypeDescription
valueT

getSliceRange

undocumented

Definition

getSliceRange(range: Range<T>): {
    startIndex: number;
    endIndex: number;
  };

Parameters

NameTypeDescription
rangeRange<T>

has

undocumented

Definition

abstract has<U>(value: RelatedTo<T, U>): boolean;

Type parameters

NameDescription
U

Parameters

NameTypeDescription
valueRelatedTo<T, U>

Overrides

VariantSetBase.has

intersect

undocumented

Definition

intersect(other: StreamSource<T>): SortedSet<T>;

Parameters

NameTypeDescription
otherStreamSource<T>

Overrides

VariantSetBase.intersect

max

undocumented

Definition

abstract max(): T;

Overrides

NonEmpty.max

min

undocumented

Definition

abstract min(): T;

Overrides

NonEmpty.min

nonEmpty

Returns true since this collection is know to be non-empty

Definition

nonEmpty(): this is WithElem<Tp, T>['nonEmpty'];

example
HashSet.of(1, 2, 3).nonEmpty()   // => true

Overrides

VariantSetBase.nonEmpty, NonEmpty.nonEmpty

normalize

undocumented

Definition

abstract normalize(): SortedSet<T>;

remove

undocumented

Definition

remove<U>(value: RelatedTo<T, U>): SortedSet<T>;

Type parameters

NameDescription
U

Parameters

NameTypeDescription
valueRelatedTo<T, U>

Overrides

VariantSetBase.remove

removeAll

undocumented

Definition

removeAll<U>(values: StreamSource<RelatedTo<T, U>>): SortedSet<T>;

Type parameters

NameDescription
U

Parameters

NameTypeDescription
valuesStreamSource<RelatedTo<T, U>>

Overrides

VariantSetBase.removeAll

removeInternal

undocumented

Definition

abstract removeInternal(value: T): SortedSetNode<T>;

Parameters

NameTypeDescription
valueT

slice

undocumented

Definition

slice(range: Range<T>): SortedSet<T>;

Parameters

NameTypeDescription
rangeRange<T>

Overrides

SortedSet.slice

sliceIndex

undocumented

Definition

sliceIndex(range: IndexRange): SortedSet<T>;

Parameters

NameTypeDescription
rangeIndexRange

Overrides

SortedSet.sliceIndex

stream

undocumented

Definition

abstract stream(options?: {
    reversed?: boolean;
  }): Stream.NonEmpty<T>;

Parameters

NameTypeDescription
options{
    reversed?: boolean;
  }

Overrides

NonEmpty.stream

streamRange

undocumented

Definition

streamRange(range: Range<T>, options?: {
    reversed?: boolean;
  }): Stream<T>;

Parameters

NameTypeDescription
rangeRange<T>
options{
    reversed?: boolean;
  }

Overrides

SortedSet.streamRange

streamSliceIndex

undocumented

Definition

abstract streamSliceIndex(range: IndexRange, options?: {
    reversed?: boolean;
  }): Stream<T>;

Parameters

NameTypeDescription
rangeIndexRange
options{
    reversed?: boolean;
  }

Overrides

SortedSet.streamSliceIndex

symDifference

undocumented

Definition

symDifference(other: StreamSource<T>): SortedSet<T>;

Parameters

NameTypeDescription
otherStreamSource<T>

Overrides

RSetBase.symDifference

take

undocumented

Definition

take(amount: number): SortedSet<T> | any;

Parameters

NameTypeDescription
amountnumber

Overrides

NonEmpty.take

toArray

undocumented

Definition

abstract toArray(): ArrayNonEmpty<T>;

Overrides

NonEmpty.toArray

toBuilder

undocumented

Definition

toBuilder(): SortedSet.Builder<T>;

Overrides

RSetBase.toBuilder

toJSON

undocumented

Definition

toJSON(): ToJSON<T[]>;

Overrides

VariantSetBase.toJSON

toString

undocumented

Definition

toString(): string;

Overrides

VariantSetBase.toString

union

undocumented

Definition

union(other: StreamSource<T>): SortedSet<T> | any;

Parameters

NameTypeDescription
otherStreamSource<T>

Overrides

NonEmpty.union