Skip to content

API / geotoolkit / util / Range / Range

Class: Range

util.Range.Range

Represents a data range, with low and high value

Table of contents

Constructors
[new Range()](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.util.range.range.md#new range())[new Range(low, high)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.util.range.range.md#new range(low, high))[new Range(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.util.range.range.md#new range(options))
[new Range(range)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.util.range.range.md#new range(range))
Accessors
Methods
Css Properties
Name Type Description
highnumberUpper range boundary
lownumberLower range boundary
maxnumber
minnumber

Contents

Constructors

new Range()

• new Range()


new Range(low, high)

• new Range(low, high)

Parameters

Name Type Description
lownumberLower range boundary
highnumberUpper range boundary

new Range(options)

• new Range(options)

Parameters

Name Type
optionsOptions

new Range(range)

• new Range(range)

Parameters

Name Type
rangeRange
Accessors

high

• get high(): number

Returns upper range boundary

Name

module:geotoolkit/util/Range~Range#high

Returns

number


low

• get low(): number

Returns lower range boundary

Name

module:geotoolkit/util/Range~Range#low

Returns

number


Infinite

• Static get Infinite(): Range

A Range instance that represents infinite range

Returns

Range

Methods

clone

▸ clone(): Range

Return clone object.

Returns

Range

clone a copy of this object


contains

▸ contains(range): boolean

Check if range contains another range or value

Parameters

Name Type Description
rangenumber | RangeThe range to check containment with current one or value

Returns

boolean


equalsRange

▸ equalsRange(range, epsilon?): boolean

returns true if the Ranges are equal

Parameters

Name Type Description
rangeRangerange to compare to
Optional epsilonnumberacceptance criteria

Returns

boolean

if these two ranges are equal


getClassName

▸ getClassName(): string

Returns

string


getHigh

▸ getHigh(): number

Gets upper range boundary

Returns

number

high value


getLow

▸ getLow(): number

Gets lower range boundary

Returns

number

lower range boundary


getProperties

▸ getProperties(): OptionsOut

Gets all the properties pertaining to this object

Example

{'low': 0, 'high': 1}

Returns

OptionsOut


getSize

▸ getSize(): number

return the size of the range

Returns

number


intersect

▸ intersect(low, high): Range

Intersect this Range and the specified one. This range will be affected.

Parameters

Name Type Description
lownumberlower range boundary
highnumberUpper range boundary

Returns

Range

this

▸ intersect(range): Range

Intersect this Range and the specified one. This range will be affected.

Parameters

Name Type Description
rangeRangerange

Returns

Range

this


intersects

▸ intersects(low, high): boolean

Determines whether this Range and the specified Range have intersection.<br> Two ranges intersect if their intersection size is longer than 0.

Parameters

Name Type Description
lownumberlower range boundary
highnumberUpper range boundary

Returns

boolean

▸ intersects(range): boolean

Determines whether this Range and the specified Range have intersection.<br> Two ranges intersect if their intersection size is longer than 0.

Parameters

Name Type Description
rangeRangerange or lower range boundary

Returns

boolean


setHigh

▸ setHigh(high): Range

Sets upper range boundary

Parameters

Name Type Description
highnumberNew upper boundary

Returns

Range


setLow

▸ setLow(low): Range

Sets lower range boundary

Parameters

Name Type Description
lownumberNew low boundary

Returns

Range


setProperties

▸ setProperties(properties?): Range

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

Range


setRange

▸ setRange(low, high): Range

Sets a new range with given lower and upper boundaries. This method checks if low is less than high otherwise swaps limits

Parameters

Name Type Description
lownumberLower range boundary
highnumberUpper range boundary

Returns

Range

▸ setRange(range): Range

Parameters

Name Type
rangeRange

Returns

Range


toString

▸ toString(): string

Returns string representation

Returns

string


union

▸ union(range): void

Union this Range with the specified

Parameters

Name Type Description
rangeRangeThe range to union with current one

Returns

void


fromObject

▸ Static fromObject(object?): Range

Create or get range from object

Parameters

Name Type Description
Optional objectRange | Optionsobject can be in format of constructor of Range

Returns

Range

range


getClassName

▸ Static getClassName(): string

Returns

string


subtract

▸ Static subtract(first, second): Range[]

Subtract second range from the first range and returns result as array of non-overlapping contiguous ranges.

Parameters

Name Type Description
firstRangethe first range
secondRangerange the first range

Returns

Range[]

array of ranges