interface SortedTableHashColumn<R,C,V>
A type-invariant immutable Table of row key type R, column key type C, and value type V. In the Table, a combination of a row and column key has exactly one value. See the Table documentation and the SortedTableHashColumn API documentation
Companion namespace: SortedTableHashColumn
Extends: TableBase<R,C,V,Tp>
Implemented by: SortedTableHashColumn.NonEmpty<R,C,V>
Type parameters
Name | Description |
---|---|
R | the row key type |
C | the column key type |
V | the value type |
- The SortedTableHashColumn uses a SortedMap to map row keys to column. - The SortedTableHashColumn uses HashMaps to map column keys to values.
const t1 = SortedTableHashColumn.empty<number, string, boolean>()
const t2 = SortedTableHashColumn.of([1, 'a', true], [2, 'a', false])
Properties
amountRows
Returns the amount of rows in the collection.
amountRows
context
Returns the context
associated to this collection instance.
context
context
associated to this collection instance.isEmpty
Returns true if the collection is empty.
isEmpty
rowMap
Returns the Map representation of this collection.
rowMap
size
Returns the amount of entries in the collection.
size
Methods
[Symbol.iterator]
Returns a FastIterator
instance used to iterate over the values of this Iterable
.
[Symbol.iterator]
FastIterator
instance used to iterate over the values of this Iterable
.addEntries
Returns the collection with the given entries
added.
addEntries
entries
added.addEntry
Returns the collection with the given entry
added.
addEntry
entry
added.assumeNonEmpty
Returns the collection as a .NonEmpty type
assumeNonEmpty
filter
Returns a collection containing only those entries that satisfy given pred
predicate.
filter
pred
predicate.filterRows
Returns a collection containing only those rows that satisfy given pred
predicate.
filterRows
pred
predicate.forEach
Performs given function f
for each entry of the collection, using given state
as initial traversal state.
forEach
f
for each entry of the collection, using given state
as initial traversal state.get
Returns the value at given row
and column
keys, or the otherwise
value if no value is present.
get
row
and column
keys, or the otherwise
value if no value is present.getRow
Returns a map containing the column keys and values in the given row
.
getRow
row
.hasRowKey
Returns true if given row
key is in the collection.
hasRowKey
row
key is in the collection.hasValueAt
Returns true if the collection has a value for given row
and column
keys.
hasValueAt
row
and column
keys.mapValues
Returns a collection with the same row and column keys, but where the given mapFun
function is applied to each entry value.
mapValues
mapFun
function is applied to each entry value.modifyAt
Returns the collection with the value at given row
and column
keys modified according to given options
.
modifyAt
row
and column
keys modified according to given options
.nonEmpty
Returns true if there is at least one entry in the collection, and instructs the compiler to treat the collection as a .NonEmpty type.
nonEmpty
remove
Returns the collection where the value at given row
and column
keys is removed.
remove
row
and column
keys is removed.removeAndGet
Returns a tuple containing the collection with the value at given row
and column
removed, and the removed value. If no such value is found, it returns undefined.
removeAndGet
row
and column
removed, and the removed value. If no such value is found, it returns undefined.removeEntries
Returns the collection where the given entries
are removed.
removeEntries
entries
are removed.removeRow
Returns the collection where all values in given row
are removed.
removeRow
row
are removed.removeRowAndGet
Returns a tuple containing the collection with the values at given row
removed, and a map containing the removed columns and values. If no such row is found, it returns undefined.
removeRowAndGet
row
removed, and a map containing the removed columns and values. If no such row is found, it returns undefined.removeRows
Returns the collection where the values for each row key in given rows
are removed.
removeRows
rows
are removed.set
Returns the collection where the given value
is associated with the given row
and column
keys.
set
value
is associated with the given row
and column
keys.stream
Returns a Stream containing all entries of this collection as tuples of row key, column key, and value.
stream
streamRows
Returns a Stream containing all row keys of this collection.
streamRows
streamValues
Returns a Stream containing all values of this collection.
streamValues
toArray
Returns an array containing all entries in this collection.
toArray
toBuilder
Returns a builder object containing the entries of this collection.
toBuilder
toJSON
Returns a JSON representation of this collection.
toJSON
toString
Returns a string representation of this collection.
toString
updateAt
Returns the collection with the value at given row
and column
keys updated according to the given update
function.
updateAt
row
and column
keys updated according to the given update
function.