class SortedSetEmpty<T>
undocumented
Implements: SortedSet<T>
Type parameters
Name | Default | Description |
---|---|---|
T | any | undocumented |
Properties
_NonEmptyType
undocumented
_NonEmptyType
Definition
_NonEmptyType:
SortedSet.NonEmpty
<T>;
context
undocumented
context
Definition
readonly context:
SortedSetContext
<T>;
Methods
add
undocumented
add
addAll
undocumented
addAll
Definition
addAll(values:
StreamSource
<T>):
SortedSet.NonEmpty
<T>;
Parameters
Name | Type | Description |
---|---|---|
values | StreamSource <T> |
drop
Returns a SortedSet containing all but the the first amount
of value of this SortedSet.
drop
amount
of value of this SortedSet.Definition
drop(amount: number):
SortedSet
<T>;
Parameters
Name | Type | Description |
---|---|---|
amount | number | the amount of elements to keep |
a negative amount
drops the last values instead of the first, e.g. -2 is the last 2 elements
const m = SortedSet.of('b', 'd', 'a', 'c').asNormal();
console.log(m.drop(2).toArray())
// => ['c', 'd']
console.log(m.drop(-2).toArray())
// => ['a', 'b']
Overrides
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.
getAtIndex
Definitions
getAtIndex(index: number): T
|
undefined;
getAtIndex<O>(index: number, otherwise:
OptLazy
<O>): T
|
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 = 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
max
Returns the maximum value of the SortedSet, or a fallback value (default: undefined) if the SortedSet is empty.
max
Definitions
max(): T
|
undefined;
max<O>(otherwise:
OptLazy
<O>): T
|
O;
const m = SortedSet.of('b', 'd', 'a', 'c').asNormal();
console.log(m.max())
// => 'a'
console.log(m.max('q'))
// => 'a'
console.log(SortedSet.empty().max())
// => undefined
console.log(SortedSet.empty().max('q'))
// => 'q'
Overrides
min
Returns the minimum value of the SortedSet, or a fallback value (default: undefined) if the SortedSet is empty.
min
Definitions
min(): T
|
undefined;
min<O>(otherwise:
OptLazy
<O>): T
|
O;
const m = SortedSet.of('b', 'd', 'a', 'c').asNormal();
console.log(m.min())
// => 'a'
console.log(m.min('q'))
// => 'a'
console.log(SortedSet.empty().min())
// => undefined
console.log(SortedSet.empty().min('q'))
// => 'q'
Overrides
slice
undocumented
slice
sliceIndex
Returns a SortedSet containing only those values that are within the given range
index range of the value sort order.
sliceIndex
range
index range of the value sort order.Definition
sliceIndex(range: IndexRange):
SortedSet
<T>;
Parameters
Name | Type | Description |
---|---|---|
range | IndexRange | an IndexRange defining the sort order indices to include. |
const m = SortedSet.of('b', 'd', 'a', 'c').asNormal();
console.log(m.sliceIndex({ start: 1, amount: 2 }).toArray())
// => ['b', 'c']
Overrides
stream
undocumented
stream
streamRange
undocumented
streamRange
streamSliceIndex
undocumented
streamSliceIndex
symDifference
undocumented
symDifference
Definition
symDifference(other:
StreamSource
<T>):
SortedSet
<T>;
Parameters
Name | Type | Description |
---|---|---|
other | StreamSource <T> |
take
Returns a SortedSet containing the the first amount
of value of this SortedSet.
take
amount
of value of this SortedSet.Definition
take(amount: number):
SortedSet
<T>;
Parameters
Name | Type | Description |
---|---|---|
amount | number | the amount of elements to keep |
a negative amount
takes the last values instead of the first, e.g. -2 is the last 2 elements
const m = SortedSet.of('b', 'd', 'a', 'c').asNormal();
console.log(m.take(2).toArray())
// => ['a', 'b']
console.log(m.take(-2).toArray())
// => ['c', 'd']
Overrides
toBuilder
undocumented
toBuilder
Definition
toBuilder():
SortedSet.Builder
<T>;
union
undocumented
union
Definition
union(other:
StreamSource
<T>):
SortedSet
<T>
|
any;
Parameters
Name | Type | Description |
---|---|---|
other | StreamSource <T> |