Skip to content

meos.js


meos.js / BigIntSpan

Class: BigIntSpan

Defined in: core/types/collections/number/BigIntSpan.ts:28

A contiguous range of 64-bit integers, stored internally as a half-open interval [lower, upper).

Example

ts
const s = BigIntSpan.fromBounds(1, 100); // [1, 100)
console.log(s.lower()); // 1
console.log(s.upper()); // 100
s.free();

Extends

Constructors

Constructor

ts
new BigIntSpan(inner): BigIntSpan;

Defined in: core/types/collections/base/Span.ts:45

Parameters

inner

number

Returns

BigIntSpan

Inherited from

Span.constructor

Accessors

inner

Get Signature

ts
get inner(): number;

Defined in: core/types/collections/base/Span.ts:57

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

Returns

number

Inherited from

Span.inner

Methods

[dispose]()

ts
dispose: void;

Defined in: core/types/collections/base/Span.ts:67

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

Returns

void

Inherited from

Span.[dispose]


asHexWKB()

ts
asHexWKB(variant?): string;

Defined in: core/types/collections/base/Span.ts:90

Serialises this span to a hex-encoded WKB string.

Parameters

variant?

number = 4

WKB encoding variant (default 4 = Extended WKB).

Returns

string

Inherited from

Span.asHexWKB


contains()

ts
contains(other): boolean;

Defined in: core/types/collections/base/Span.ts:149

true if this entirely contains other.

Parameters

other

this

Returns

boolean

Inherited from

Span.contains


copy()

ts
copy(): this;

Defined in: core/types/collections/base/Span.ts:75

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

Returns

this

Inherited from

Span.copy


distance()

ts
distance(other): number;

Defined in: core/types/collections/number/BigIntSpan.ts:115

Returns the distance (gap) between this and other in integers. Returns 0 if they overlap or are adjacent.

Parameters

other

this

Returns

number

Overrides

Span.distance


eq()

ts
eq(other): boolean;

Defined in: core/types/collections/base/Span.ts:233

true if this and other have identical bounds and inclusivity.

Parameters

other

this

Returns

boolean

Inherited from

Span.eq


expand()

ts
expand(value): BigIntSpan;

Defined in: core/types/collections/number/BigIntSpan.ts:127

Returns a new span expanded by value on each side.

Parameters

value

number

Number of integers to add to each end.

Returns

BigIntSpan


free()

ts
free(): void;

Defined in: core/types/collections/base/Span.ts:62

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

Returns

void

Inherited from

Span.free


ge()

ts
ge(other): boolean;

Defined in: core/types/collections/base/Span.ts:258

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

Parameters

other

this

Returns

boolean

Inherited from

Span.ge


gt()

ts
gt(other): boolean;

Defined in: core/types/collections/base/Span.ts:253

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

Parameters

other

this

Returns

boolean

Inherited from

Span.gt


hash()

ts
hash(): number;

Defined in: core/types/collections/base/Span.ts:121

32-bit integer hash of this span.

Returns

number

Inherited from

Span.hash


intersection()

ts
intersection(other): BigIntSpan | null;

Defined in: core/types/collections/base/Span.ts:207

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

BigIntSpan | null

Inherited from

Span.intersection


isAdjacent()

ts
isAdjacent(other): boolean;

Defined in: core/types/collections/number/BigIntSpan.ts:103

true if this and other touch at exactly one boundary point without overlapping.

Parameters

other

this

Returns

boolean

Overrides

Span.isAdjacent


isAfter()

ts
isAfter(other): boolean;

Defined in: core/types/collections/base/Span.ts:176

true if every point in this is strictly greater than every point in other (no overlap).

Parameters

other

this

Returns

boolean

Inherited from

Span.isAfter


isBefore()

ts
isBefore(other): boolean;

Defined in: core/types/collections/base/Span.ts:163

true if every point in this is strictly less than every point in other (no overlap).

Parameters

other

this

Returns

boolean

Inherited from

Span.isBefore


isContainedIn()

ts
isContainedIn(other): boolean;

Defined in: core/types/collections/base/Span.ts:144

true if this is entirely contained within other.

Parameters

other

this

Returns

boolean

Inherited from

Span.isContainedIn


isOverOrAfter()

ts
isOverOrAfter(other): boolean;

Defined in: core/types/collections/base/Span.ts:184

true if this does not extend to the left of other (i.e. min(this) ≥ min(other)).

Parameters

other

this

Returns

boolean

Inherited from

Span.isOverOrAfter


isOverOrBefore()

ts
isOverOrBefore(other): boolean;

Defined in: core/types/collections/base/Span.ts:171

true if this does not extend to the right of other (i.e. max(this) ≤ max(other)).

Parameters

other

this

Returns

boolean

Inherited from

Span.isOverOrBefore


le()

ts
le(other): boolean;

Defined in: core/types/collections/base/Span.ts:248

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

Parameters

other

this

Returns

boolean

Inherited from

Span.le


lower()

ts
lower(): number;

Defined in: core/types/collections/number/BigIntSpan.ts:82

Returns the inclusive lower bound.

Returns

number

Overrides

Span.lower


lowerInc()

ts
lowerInc(): boolean;

Defined in: core/types/collections/base/Span.ts:111

true if the lower bound is inclusive ([).

Returns

boolean

Inherited from

Span.lowerInc


lt()

ts
lt(other): boolean;

Defined in: core/types/collections/base/Span.ts:243

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

Parameters

other

this

Returns

boolean

Inherited from

Span.lt


minus()

ts
minus(other): number;

Defined in: core/types/collections/base/Span.ts:216

Returns the part of this that is not in other as a raw WASM pointer. The result may represent a SpanSet when the subtraction splits this span into two parts.

Parameters

other

this

Returns

number

Inherited from

Span.minus


ne()

ts
ne(other): boolean;

Defined in: core/types/collections/base/Span.ts:238

true if this and other differ in at least one bound or inclusivity.

Parameters

other

this

Returns

boolean

Inherited from

Span.ne


overlaps()

ts
overlaps(other): boolean;

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

true if this and other share at least one point.

Parameters

other

this

Returns

boolean

Inherited from

Span.overlaps


shiftScale()

ts
shiftScale(
   shift, 
   width, 
   hasShift?, 
   hasWidth?): BigIntSpan;

Defined in: core/types/collections/number/BigIntSpan.ts:138

Returns a new span shifted and/or scaled along the integer axis.

Parameters

shift

number

Amount to add to every bound (ignored when hasShift is false).

width

number

New total width (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

BigIntSpan


toSpanSet()

ts
toSpanSet(): number;

Defined in: core/types/collections/base/Span.ts:129

Wraps this span in a one-element SpanSet and returns the raw WASM pointer. Use the appropriate SpanSet constructor (e.g. new IntSpanSet(ptr)) to obtain a typed object.

Returns

number

Inherited from

Span.toSpanSet


toString()

ts
toString(): string;

Defined in: core/types/collections/number/BigIntSpan.ts:77

Returns the WKT string representation (e.g. [1, 100)).

Returns

string

Overrides

Span.toString


union()

ts
union(other): number;

Defined in: core/types/collections/base/Span.ts:224

Returns the union of this and other as a raw WASM pointer. The spans do not need to be adjacent or overlapping.

Parameters

other

this

Returns

number

Inherited from

Span.union


upper()

ts
upper(): number;

Defined in: core/types/collections/number/BigIntSpan.ts:87

Returns the exclusive upper bound (stored half-open).

Returns

number

Overrides

Span.upper


upperInc()

ts
upperInc(): boolean;

Defined in: core/types/collections/base/Span.ts:116

true if the upper bound is inclusive (]).

Returns

boolean

Inherited from

Span.upperInc


width()

ts
width(): number;

Defined in: core/types/collections/number/BigIntSpan.ts:92

Returns the number of integers in this span (upper - lower).

Returns

number


fromBounds()

ts
static fromBounds(
   lower, 
   upper, 
   lowerInc?, 
   upperInc?): BigIntSpan;

Defined in: core/types/collections/number/BigIntSpan.ts:55

Creates a BigIntSpan from explicit integer bounds. MEOS normalises integer spans to half-open form internally, so fromBounds(1, 10, true, true) is stored as [1, 11).

Parameters

lower

number

Lower bound value.

upper

number

Upper bound value.

lowerInc?

boolean = true

true for inclusive lower bound [ (default).

upperInc?

boolean = false

true for inclusive upper bound ] (default false).

Returns

BigIntSpan


fromHexWKB()

ts
static fromHexWKB(hexwkb): BigIntSpan;

Defined in: core/types/collections/number/BigIntSpan.ts:68

Deserialises a BigIntSpan from a hex-encoded WKB string produced by asHexWKB.

Parameters

hexwkb

string

Hex-encoded WKB string.

Returns

BigIntSpan


fromString()

ts
static fromString(str): BigIntSpan;

Defined in: core/types/collections/number/BigIntSpan.ts:41

Parses a BigIntSpan from its WKT string representation.

Parameters

str

string

WKT string, e.g. "[1, 100)".

Returns

BigIntSpan