abstract class SortedMapNode<K,V>
undocumented
Implements: SortedMap.NonEmpty<K,V>
Extended by: SortedMapInner<K,V>
, SortedMapLeaf<K,V>
Type parameters
Name | Description |
---|---|
K | undocumented |
V | undocumented |
Properties
_NonEmptyType
undocumented
_NonEmptyType
Definition
_NonEmptyType:
SortedMap.NonEmpty
<K, V>;
context
undocumented
context
isEmpty
Returns false since this collection is known to be non-empty.
isEmpty
size
undocumented
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
undocumented
addEntries
Definition
addEntries(entries:
StreamSource
<readonly [K, V]>):
SortedMap.NonEmpty
<K, V>;
Parameters
Name | Type | Description |
---|---|---|
entries | StreamSource <readonly [K, V]> |
Overrides
addEntry
undocumented
addEntry
Definition
addEntry(entry: readonly [K, V]):
SortedMap.NonEmpty
<K, V>;
Parameters
Name | Type | Description |
---|---|---|
entry | readonly [K, V] |
Overrides
addInternal
undocumented
addInternal
Definition
abstract addInternal(entry: readonly [K, V], hash?: number):
SortedMapNode
<K, V>;
Parameters
Name | Type | Description |
---|---|---|
entry | readonly [K, V] | |
hash | number |
asNormal
undocumented
asNormal
assumeNonEmpty
Returns a self reference since this collection is known to be non-empty.
assumeNonEmpty
drop
undocumented
drop
filter
undocumented
filter
forEach
undocumented
forEach
Definition
abstract forEach(f: (entry: readonly [K, V], index: number, halt: () => void) => void, options?: {
state?:
TraverseState
;
}): void;
Parameters
Name | Type | Description |
---|---|---|
f | (entry: readonly [K, V], index: number, halt: () => void) => void | |
options | { state?: TraverseState ; } |
Overrides
get
undocumented
get
getAtIndex
Returns the entry with its key at the given index of the key sort order of the SortedMap, or a fallback value (default: undefined) if the index is out of bounds.
getAtIndex
Definitions
getAtIndex(index: number): readonly [K, V]
|
undefined;
getAtIndex<O>(index: number, otherwise:
OptLazy
<O>): readonly [K, V]
|
O;
Parameters
Name | Type | Description |
---|---|---|
index | number | the index in the key sort order |
negative index values will retrieve the values from the end of the sort order, e.g. -1 is the last value
const m = SortedMap.of(['b', 2], ['d', 4], ['a', 1], ['c', 3]).asNormal();
console.log(m.getAtIndex(1))
// => ['b', 2]
console.log(m.getAtIndex(-1))
// => ['d', 4]
console.log(m.getAtIndex(10))
// => undefined
console.log(m.getAtIndex(10, 'q'))
// => 'q'
Overrides
getInsertIndexOf
undocumented
getInsertIndexOf
getKeyAtIndex
undocumented
getKeyAtIndex
getSliceRange
undocumented
getSliceRange
getValueAtIndex
undocumented
getValueAtIndex
hasKey
undocumented
hasKey
mapValues
undocumented
mapValues
Definition
abstract mapValues<V2>(mapFun: (value: V, key: K) => V2):
SortedMapNode
<K, V2>;
Type parameters
Name | Description |
---|---|
V2 |
Parameters
Name | Type | Description |
---|---|---|
mapFun | (value: V, key: K) => V2 |
Overrides
max
undocumented
max
maxKey
undocumented
maxKey
maxValue
undocumented
maxValue
min
undocumented
min
minKey
undocumented
minKey
minValue
undocumented
minValue
modifyAt
undocumented
modifyAt
modifyAtInternal
undocumented
modifyAtInternal
Definition
abstract modifyAtInternal(atKey: K, options: {
ifNew?:
OptLazyOr
<V, Token>;
ifExists?: ((currentEntry: V, remove: Token) => V
|
Token)
|
V;
}):
SortedMapNode
<K, V>;
Parameters
Name | Type | Description |
---|---|---|
atKey | K | |
options | { ifNew?: OptLazyOr <V, Token>; ifExists?: ((currentEntry: V, remove: Token) => V | Token) | V; } |
nonEmpty
Returns true since this collection is known to be non-empty
nonEmpty
Definition
nonEmpty(): this is
WithKeyValue
<Tp, K, V>['nonEmpty'];
HashMap.of([1, 1], [2, 2]).nonEmpty() // => true
Overrides
removeKey
undocumented
removeKey
removeKeyAndGet
undocumented
removeKeyAndGet
removeKeys
undocumented
removeKeys
Definition
removeKeys<UK>(keys:
StreamSource
<
RelatedTo
<K, UK>>):
SortedMap
<K, V>;
Type parameters
Name | Description |
---|---|
UK |
Parameters
Name | Type | Description |
---|---|---|
keys | StreamSource < RelatedTo <K, UK>> |
Overrides
set
undocumented
set
Definition
set(key: K, value: V):
SortedMap.NonEmpty
<K, V>;
Parameters
Name | Type | Description |
---|---|---|
key | K | |
value | V |
Overrides
slice
undocumented
slice
sliceIndex
undocumented
sliceIndex
stream
undocumented
stream
Definition
abstract stream(options?: {
reversed?: boolean;
}):
Stream.NonEmpty
<readonly [K, V]>;
Parameters
Name | Type | Description |
---|---|---|
options | { reversed?: boolean; } |
Overrides
streamKeys
undocumented
streamKeys
Definition
streamKeys(options?: {
reversed?: boolean;
}):
Stream.NonEmpty
<K>;
Parameters
Name | Type | Description |
---|---|---|
options | { reversed?: boolean; } |
Overrides
streamRange
undocumented
streamRange
streamSliceIndex
undocumented
streamSliceIndex
streamValues
undocumented
streamValues
Definition
streamValues(options?: {
reversed?: boolean;
}):
Stream.NonEmpty
<V>;
Parameters
Name | Type | Description |
---|---|---|
options | { reversed?: boolean; } |
Overrides
take
undocumented
take
toArray
undocumented
toArray
toBuilder
undocumented
toBuilder
toJSON
undocumented
toJSON
toString
undocumented
toString