Skip to main content

class TableContext<UR,UC,N,Tp>

undocumented

Implements: TableBase.Context<UR,UC,Tp>

Type parameters

NameConstraintsDefaultDescription
URundocumented
UCundocumented
Nstringundocumented
TpContextImplTypes ContextImplTypesundocumented

Properties

_empty

undocumented

Definition

readonly _empty: Readonly<WithRow<Tp, UR, UC, any>["normal"]>;

_fixedKeys

undocumented

Definition

readonly _fixedKeys: readonly [UR, UC];

Overrides

Context._fixedKeys

_types

undocumented

Definition

get _types(): Tp;

Overrides

Context._types

builder

undocumented

Definition

readonly builder: <R extends UR, C extends UC, V>() => WithRow<Tp, R, C, V>["builder"];

columnContext

undocumented

Definition

readonly columnContext: WithRow<Tp, UR, UC, any>['columnContext'];

Overrides

Context.columnContext

empty

undocumented

Definition

readonly empty: <R extends UR, C extends UC, V>() => WithRow<Tp, R, C, V>["normal"];

from

undocumented

Definition

readonly from: any;

of

undocumented

Definition

readonly of: any;

reducer

undocumented

Definition

readonly reducer: <R extends UR, C extends UC, V>(source?: StreamSource<readonly [R, C, V]>) => Reducer<[R, C, V], WithRow<Tp, R, C, V>["normal"]>;

rowContext

undocumented

Definition

readonly rowContext: WithRow<Tp, UR, UC, any>['rowContext'];

Overrides

Context.rowContext

typeTag

undocumented

Definition

readonly typeTag: N;

Overrides

Context.typeTag

Methods

builder

Returns an empty builder instance for this type of collection and context.

Definition

builder<R extends UR, C extends UC, V>(): WithRow<Tp, R, C, V>['builder'];

Type parameters

NameConstraintsDescription
RUR
CUC
V
example
HashTableHashColumn.builder<number, string, boolean>()    // => HashTableHashColumn.Builder<number, string, boolean>

Overrides

Factory.builder

createBuilder

undocumented

Definition

createBuilder<R extends UR, C extends UC, V>(source?: Table.NonEmpty<R, C, V>): WithRow<Tp, R, C, V>['builder'];

Type parameters

NameConstraintsDescription
RUR
CUC
V

Parameters

NameTypeDescription
sourceTable.NonEmpty<R, C, V>

createNonEmpty

undocumented

Definition

createNonEmpty<R extends UR, C extends UC, V>(rowMap: WithRow<Tp, R, C, V>['rowMapNonEmpty'], size: number): WithRow<Tp, R, C, V>['nonEmpty'];

Type parameters

NameConstraintsDescription
RUR
CUC
V

Parameters

NameTypeDescription
rowMapWithRow<Tp, R, C, V>['rowMapNonEmpty']
sizenumber

empty

Returns the (singleton) empty instance of this type and context with given key and value types.

Definition

empty<R extends UR, C extends UC, V>(): WithRow<Tp, R, C, V>['normal'];

Type parameters

NameConstraintsDescription
RUR
CUC
V
example
HashTableHashColumn.empty<number, string, boolean>()    // => HashTableHashColumn<number, string, boolean>
HashTableHashColumn.empty<string, boolean, number>() // => HashTableHashColumn<string, boolean, number>

Overrides

Factory.empty

from

Returns an immutable table of this type and context, containing the entries in the given sources StreamSource instances.

Definitions

from<R extends UR, C extends UC, V>(...sources: ArrayNonEmpty<StreamSource.NonEmpty<readonly [R, C, V]>>): WithRow<Tp, R, C, V>['nonEmpty'];

from<R extends UR, C extends UC, V>(...sources: ArrayNonEmpty<StreamSource<readonly [R, C, V]>>): WithRow<Tp, R, C, V>['normal'];

Type parameters

NameConstraintsDescription
RUR
CUC
V

Parameters

NameTypeDescription
sourcesArrayNonEmpty<StreamSource.NonEmpty<readonly [R, C, V]>>an array of StreamSource instances containing row-column-value entries
example
HashTableHashColumn.from([[1, 2, 3], [1, 4, 5]])    // => HashTableHashColumn.NonEmpty<number, number, number>

Overrides

Factory.from

isNonEmptyInstance

undocumented

Definition

isNonEmptyInstance<R, C, V>(source: any): source is WithRow<Tp, R, C, V>['nonEmpty'];

Type parameters

NameDescription
R
C
V

Parameters

NameTypeDescription
sourceany

of

Returns an immutable multimap of this collection type and context, containing the given entries.

Definition

of<R extends UR, C extends UC, V>(...entries: ArrayNonEmpty<readonly [R, C, V]>): WithRow<Tp, R, C, V>['nonEmpty'];

Type parameters

NameConstraintsDescription
RUR
CUC
V

Parameters

NameTypeDescription
entriesArrayNonEmpty<readonly [R, C, V]>a non-empty array of row-column-value entries
example
HashTableHashColumn.of([1, 2, 3], [1, 4, 5])    // => HashTableHashColumn.NonEmpty<number, number, number>

Overrides

Factory.of

reducer

Returns a Reducer that adds received tuples to a Table and returns the Table as a result. When a source is given, the reducer will first create a Table from the source, and then add tuples to it.

Definition

reducer<R extends UR, C extends UC, V>(source?: StreamSource<readonly [R, C, V]>): Reducer<[R, C, V], WithRow<Tp, R, C, V>['normal']>;

Type parameters

NameConstraintsDescription
RUR
CUC
V

Parameters

NameTypeDescription
sourceStreamSource<readonly [R, C, V]>(optional) an initial source of tuples to add to
example
const someSource = Table.of([1, 'a', true], [2, 'b', false]);
const result = Stream.of([1, 'c', true], [3, 'a', false]).reduce(Table.reducer(someSource))
result.toArray() // => [[1, 'c'], [2, 'b'], [3, 'a']]
note

uses a builder under the hood. If the given source is a Table in the same context, it will directly call .toBuilder().

Overrides

Factory.reducer