Appearance
meos.js / DateSet
Class: DateSet
Defined in: core/types/collections/time/DateSet.ts:28
An ordered set of distinct calendar dates.
Dates are represented as DateADT integers (days since 2000-01-01).
Example
ts
const s = DateSet.fromString('{2020-01-01, 2020-06-15, 2020-12-31}');
console.log(s.numValues()); // 3
console.log(s.startValue()); // days since 2000-01-01
s.free();Extends
MeosSet<DateADT>
Constructors
Constructor
ts
new DateSet(inner): DateSet;Defined in: core/types/collections/base/MeosSet.ts:46
Parameters
inner
number
Returns
DateSet
Inherited from
Accessors
inner
Get Signature
ts
get inner(): number;Defined in: core/types/collections/base/MeosSet.ts:58
Raw WASM heap pointer. Do not free this value directly; use free.
Returns
number
Inherited from
Methods
[dispose]()
ts
dispose: void;Defined in: core/types/collections/base/MeosSet.ts:68
Implements the using resource-management protocol — calls free automatically.
Returns
void
Inherited from
asHexWKB()
ts
asHexWKB(variant?): string;Defined in: core/types/collections/base/MeosSet.ts:91
Serialises this set to a hex-encoded WKB string.
Parameters
variant?
number = 4
WKB encoding variant (default 4 = Extended WKB).
Returns
string
Inherited from
contains()
ts
contains(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:147
true if this contains every element of other.
Parameters
other
this
Returns
boolean
Inherited from
copy()
ts
copy(): this;Defined in: core/types/collections/base/MeosSet.ts:76
Returns a deep copy of this set. The caller is responsible for calling free on the returned copy.
Returns
this
Inherited from
distance()
ts
distance(other): number;Defined in: core/types/collections/time/DateSet.ts:92
Returns the distance (gap) between this and other in days. Returns 0 if they share at least one date.
Parameters
other
DateSet
Returns
number
Overrides
endValue()
ts
endValue(): number;Defined in: core/types/collections/time/DateSet.ts:72
Returns the latest date in this set as days since 2000-01-01.
Returns
number
Overrides
eq()
ts
eq(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:232
true if this and other contain the same elements.
Parameters
other
this
Returns
boolean
Inherited from
free()
ts
free(): void;Defined in: core/types/collections/base/MeosSet.ts:63
Releases the WASM-allocated memory. Must be called when the object is no longer needed.
Returns
void
Inherited from
ge()
ts
ge(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:257
true if this is greater than or equal to other in MEOS total ordering.
Parameters
other
this
Returns
boolean
Inherited from
gt()
ts
gt(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:252
true if this is strictly greater than other in MEOS total ordering.
Parameters
other
this
Returns
boolean
Inherited from
hash()
ts
hash(): number;Defined in: core/types/collections/base/MeosSet.ts:105
32-bit integer hash of this set.
Returns
number
Inherited from
intersection()
ts
intersection(other): DateSet | null;Defined in: core/types/collections/base/MeosSet.ts:205
Returns the intersection of this and other, or null if they are disjoint. The caller is responsible for calling free on the result.
Parameters
other
this
Returns
DateSet | null
Inherited from
isAfter()
ts
isAfter(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:174
true if every element of this is strictly greater than every element of other.
Parameters
other
this
Returns
boolean
Inherited from
isBefore()
ts
isBefore(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:161
true if every element of this is strictly less than every element of other.
Parameters
other
this
Returns
boolean
Inherited from
isContainedIn()
ts
isContainedIn(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:142
true if this is entirely contained within other (every element of this is in other).
Parameters
other
this
Returns
boolean
Inherited from
isOverOrAfter()
ts
isOverOrAfter(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:182
true if this does not extend to the left of other (i.e. min(this) ≥ min(other)).
Parameters
other
this
Returns
boolean
Inherited from
isOverOrBefore()
ts
isOverOrBefore(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:169
true if this does not extend to the right of other (i.e. max(this) ≤ max(other)).
Parameters
other
this
Returns
boolean
Inherited from
le()
ts
le(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:247
true if this is less than or equal to other in MEOS total ordering.
Parameters
other
this
Returns
boolean
Inherited from
lt()
ts
lt(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:242
true if this is strictly less than other in MEOS total ordering.
Parameters
other
this
Returns
boolean
Inherited from
minus()
ts
minus(other): DateSet | null;Defined in: core/types/collections/base/MeosSet.ts:214
Returns the part of this not in other, or null if the result is empty. The caller is responsible for calling free on the result.
Parameters
other
this
Returns
DateSet | null
Inherited from
ne()
ts
ne(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:237
true if this and other differ in at least one element.
Parameters
other
this
Returns
boolean
Inherited from
numValues()
ts
numValues(): number;Defined in: core/types/collections/base/MeosSet.ts:100
Number of elements in this set.
Returns
number
Inherited from
overlaps()
ts
overlaps(other): boolean;Defined in: core/types/collections/base/MeosSet.ts:152
true if this and other share at least one element.
Parameters
other
this
Returns
boolean
Inherited from
shiftScale()
ts
shiftScale(
shift,
width,
hasShift?,
hasWidth?): DateSet;Defined in: core/types/collections/time/DateSet.ts:115
Returns a new set shifted and/or scaled along the date axis.
Parameters
shift
number
Number of days to shift (ignored when hasShift is false).
width
number
New total width in days (ignored when hasWidth is false).
hasShift?
boolean = true
Set to false to skip shifting (default true).
hasWidth?
boolean = true
Set to false to skip scaling (default true).
Returns
DateSet
startValue()
ts
startValue(): number;Defined in: core/types/collections/time/DateSet.ts:67
Returns the earliest date in this set as days since 2000-01-01.
Returns
number
Overrides
toSpan()
ts
toSpan(): number;Defined in: core/types/collections/base/MeosSet.ts:113
Returns the bounding span of this set as a raw WASM pointer. Use the appropriate Span constructor to obtain a typed object.
Returns
number
Inherited from
toSpanSet()
ts
toSpanSet(): number;Defined in: core/types/collections/base/MeosSet.ts:121
Returns this set converted to a SpanSet as a raw WASM pointer. Use the appropriate SpanSet constructor to obtain a typed object.
Returns
number
Inherited from
toString()
ts
toString(): string;Defined in: core/types/collections/time/DateSet.ts:58
Returns the WKT string representation (e.g. {2020-01-01, 2020-06-15}).
Returns
string
Overrides
toTsTzSet()
ts
toTsTzSet(): number;Defined in: core/types/collections/time/DateSet.ts:104
Converts each date to a timestamp at midnight UTC and returns the raw WASM pointer. Use new TsTzSet(ptr) to obtain a typed object.
Returns
number
union()
ts
union(other): this;Defined in: core/types/collections/base/MeosSet.ts:223
Returns the union of this and other. The caller is responsible for calling free on the result.
Parameters
other
this
Returns
this
Inherited from
valueN()
ts
valueN(n): number;Defined in: core/types/collections/time/DateSet.ts:80
Returns the n-th date (0-based index) as days since 2000-01-01.
Parameters
n
number
0-based index (MEOS internally uses 1-based indexing).
Returns
number
Overrides
fromHexWKB()
ts
static fromHexWKB(hexwkb): DateSet;Defined in: core/types/collections/time/DateSet.ts:49
Deserialises a DateSet from a hex-encoded WKB string produced by asHexWKB.
Parameters
hexwkb
string
Hex-encoded WKB string.
Returns
DateSet
fromString()
ts
static fromString(str): DateSet;Defined in: core/types/collections/time/DateSet.ts:41
Parses a DateSet from its WKT string representation.
Parameters
str
string
WKT string, e.g. "{2020-01-01, 2020-06-15, 2020-12-31}".
Returns
DateSet