Skip to content

meos.js


meos.js / SpanSet

Abstract Class: SpanSet<S>

Defined in: core/types/collections/base/SpanSet.ts:60

Abstract base class for all MEOS span-set types (ordered sets of disjoint spans).

A span set holds one or more non-overlapping, non-adjacent spans of the same type, ordered by their lower bound.

Concrete subclasses: IntSpanSet, FloatSpanSet, DateSpanSet, TsTzSpanSet.

Remarks

Every span-set object wraps a WASM heap pointer and must be released with free (or a using declaration) when no longer needed.

Extended by

Type Parameters

S

S extends Span

The companion Span subclass (e.g. IntSpan).

Constructors

Constructor

ts
new SpanSet<S>(inner): SpanSet<S>;

Defined in: core/types/collections/base/SpanSet.ts:63

Parameters

inner

number

Returns

SpanSet<S>

Accessors

inner

Get Signature

ts
get inner(): number;

Defined in: core/types/collections/base/SpanSet.ts:77

Raw WASM heap pointer. Do not free this value directly; use free.

Returns

number

Methods

[dispose]()

ts
dispose: void;

Defined in: core/types/collections/base/SpanSet.ts:87

Implements the using resource-management protocol — calls free automatically.

Returns

void


asHexWKB()

ts
asHexWKB(variant?): string;

Defined in: core/types/collections/base/SpanSet.ts:110

Serialises this span set to a hex-encoded WKB string.

Parameters

variant?

number = 4

WKB encoding variant (default 4 = Extended WKB).

Returns

string


boundingSpan()

ts
boundingSpan(): S;

Defined in: core/types/collections/base/SpanSet.ts:154

Returns the smallest span that covers all spans in this set (the bounding span). The caller is responsible for calling Span.free on the result.

Returns

S


contains()

ts
contains(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:209

true if this entirely contains other. Accepts either a companion span or another span set of the same type.

Parameters

other

S | SpanSet<S>

Returns

boolean


copy()

ts
copy(): this;

Defined in: core/types/collections/base/SpanSet.ts:95

Returns a deep copy of this span set. The caller is responsible for calling free on the returned copy.

Returns

this


distance()

ts
abstract distance(other): number;

Defined in: core/types/collections/base/SpanSet.ts:274

Returns the distance between this and other. Returns 0 if they overlap. Accepts either a companion span or another span set. The unit depends on the concrete type.

Parameters

other

S | SpanSet<S>

Returns

number


endSpan()

ts
endSpan(): S;

Defined in: core/types/collections/base/SpanSet.ts:170

Returns the last (rightmost) span in this set. The caller is responsible for calling Span.free on the result.

Returns

S


eq()

ts
eq(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:324

true if this and other are identical (same spans, bounds, and inclusivity).

Parameters

other

this

Returns

boolean


free()

ts
free(): void;

Defined in: core/types/collections/base/SpanSet.ts:82

Releases the WASM-allocated memory. Must be called when the object is no longer needed.

Returns

void


ge()

ts
ge(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:349

true if this is greater than or equal to other in MEOS total ordering.

Parameters

other

this

Returns

boolean


gt()

ts
gt(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:344

true if this is strictly greater than other in MEOS total ordering.

Parameters

other

this

Returns

boolean


hash()

ts
hash(): number;

Defined in: core/types/collections/base/SpanSet.ts:146

32-bit integer hash of this span set.

Returns

number


intersection()

ts
intersection(other): SpanSet<S> | null;

Defined in: core/types/collections/base/SpanSet.ts:285

Returns the intersection of this and other, or null if they are disjoint. Accepts either a companion span or another span set of the same type. The caller is responsible for calling free on the result.

Parameters

other

S | SpanSet<S>

Returns

SpanSet<S> | null


isAdjacent()

ts
isAdjacent(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:191

true if this and other share exactly one boundary point without overlapping. Accepts either a companion span or another span set of the same type.

Parameters

other

S | SpanSet<S>

Returns

boolean


isAfter()

ts
isAfter(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:250

true if every point in this is strictly greater than every point in other. Accepts either a companion span or another span set of the same type.

Parameters

other

S | SpanSet<S>

Returns

boolean


isBefore()

ts
isBefore(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:231

true if every point in this is strictly less than every point in other. Accepts either a companion span or another span set of the same type.

Parameters

other

S | SpanSet<S>

Returns

boolean


isContainedIn()

ts
isContainedIn(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:200

true if this is entirely contained within other. Accepts either a companion span or another span set of the same type.

Parameters

other

S | SpanSet<S>

Returns

boolean


isOverOrAfter()

ts
isOverOrAfter(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:260

true if this does not extend to the left of other (i.e. min(this) ≥ min(other)). Accepts either a companion span or another span set of the same type.

Parameters

other

S | SpanSet<S>

Returns

boolean


isOverOrBefore()

ts
isOverOrBefore(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:241

true if this does not extend to the right of other (i.e. max(this) ≤ max(other)). Accepts either a companion span or another span set of the same type.

Parameters

other

S | SpanSet<S>

Returns

boolean


le()

ts
le(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:339

true if this is less than or equal to other in MEOS total ordering.

Parameters

other

this

Returns

boolean


lower()

ts
abstract lower(): number;

Defined in: core/types/collections/base/SpanSet.ts:122

Returns the lower bound of the first (leftmost) span. The concrete type determines the unit.

Returns

number


lowerInc()

ts
lowerInc(): boolean;

Defined in: core/types/collections/base/SpanSet.ts:131

true if the lower bound of the first span is inclusive ([).

Returns

boolean


lt()

ts
lt(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:334

true if this is strictly less than other in MEOS total ordering.

Parameters

other

this

Returns

boolean


minus()

ts
minus(other): SpanSet<S> | null;

Defined in: core/types/collections/base/SpanSet.ts:298

Returns the part of this that is not in other, or null if the result is empty. Accepts either a companion span or another span set of the same type. The caller is responsible for calling free on the result.

Parameters

other

S | SpanSet<S>

Returns

SpanSet<S> | null


ne()

ts
ne(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:329

true if this and other differ in at least one span.

Parameters

other

this

Returns

boolean


numSpans()

ts
numSpans(): number;

Defined in: core/types/collections/base/SpanSet.ts:141

Number of spans in this set.

Returns

number


overlaps()

ts
overlaps(other): boolean;

Defined in: core/types/collections/base/SpanSet.ts:218

true if this and other share at least one point. Accepts either a companion span or another span set of the same type.

Parameters

other

S | SpanSet<S>

Returns

boolean


spanN()

ts
spanN(n): S;

Defined in: core/types/collections/base/SpanSet.ts:179

Returns the n-th span (0-based index). The caller is responsible for calling Span.free on the result.

Parameters

n

number

0-based index (MEOS internally uses 1-based indexing).

Returns

S


startSpan()

ts
startSpan(): S;

Defined in: core/types/collections/base/SpanSet.ts:162

Returns the first (leftmost) span in this set. The caller is responsible for calling Span.free on the result.

Returns

S


toString()

ts
abstract toString(): string;

Defined in: core/types/collections/base/SpanSet.ts:104

Returns the WKT string representation (e.g. {[1, 5), [8, 12)}).

Returns

string


union()

ts
union(other): this;

Defined in: core/types/collections/base/SpanSet.ts:311

Returns the union of this and other. Accepts either a companion span or another span set of the same type. The caller is responsible for calling free on the result.

Parameters

other

S | SpanSet<S>

Returns

this


upper()

ts
abstract upper(): number;

Defined in: core/types/collections/base/SpanSet.ts:128

Returns the upper bound of the last (rightmost) span. The concrete type determines the unit.

Returns

number


upperInc()

ts
upperInc(): boolean;

Defined in: core/types/collections/base/SpanSet.ts:136

true if the upper bound of the last span is inclusive (]).

Returns

boolean