# SimpleRangeValue Class

A class that represents a range of data.

# Constructors

# constructor

+ new SimpleRangeValue(_data?: InternalScalarValue[][], range?: AbsoluteCellRange, dependencyGraph?: DependencyGraph, _hasOnlyNumbers?: undefined | false | true): SimpleRangeValue

Defined in src/SimpleRangeValue.ts:21 (opens new window)

In most cases, it's more convenient to create a SimpleRangeValue object by calling one of the static factory methods.

Parameters:

Name Type
_data? InternalScalarValue[][]
range? AbsoluteCellRange
dependencyGraph? DependencyGraph
_hasOnlyNumbers? undefined | false | true

Returns: SimpleRangeValue

# Properties

# range OptionalReadonly

• range? : AbsoluteCellRange

Defined in src/SimpleRangeValue.ts:33 (opens new window)

A property that represents the address of the range.


# size Readonly

• size: ArraySize

Defined in src/SimpleRangeValue.ts:21 (opens new window)

A property that represents the size of the range.

# Accessors

# data

• get data(): InternalScalarValue[][]

Defined in src/SimpleRangeValue.ts:45 (opens new window)

Returns the range data as a 2D array.

Returns: InternalScalarValue[][]

# Methods

# effectiveAddressesFromData

▸ effectiveAddressesFromData(leftCorner: SimpleCellAddress): IterableIterator‹SimpleCellAddress›

Defined in src/SimpleRangeValue.ts:125 (opens new window)

Generates the addresses of the cells contained in the range assuming the provided address is the left corner of the range.

Parameters:

Name Type
leftCorner SimpleCellAddress

Returns: IterableIterator‹SimpleCellAddress›


# entriesFromTopLeftCorner

▸ entriesFromTopLeftCorner(leftCorner: SimpleCellAddress): IterableIterator‹[InternalScalarValue, SimpleCellAddress]›

Defined in src/SimpleRangeValue.ts:139 (opens new window)

Generates values and addresses of the cells contained in the range assuming the provided address is the left corner of the range.

This method combines the functionalities of iterateValuesFromTopLeftCorner() and effectiveAddressesFromData().

Parameters:

Name Type
leftCorner SimpleCellAddress

Returns: IterableIterator‹[InternalScalarValue, SimpleCellAddress]›


# hasOnlyNumbers

▸ hasOnlyNumbers(): boolean

Defined in src/SimpleRangeValue.ts:165 (opens new window)

Returns true if and only if the range contains only numeric values.

Returns: boolean


# height

▸ height(): number

Defined in src/SimpleRangeValue.ts:102 (opens new window)

Returns the number of rows contained in the range.

Returns: number


# isAdHoc

▸ isAdHoc(): boolean

Defined in src/SimpleRangeValue.ts:88 (opens new window)

Returns true if and only if the SimpleRangeValue has no address set.

Returns: boolean


# iterateValuesFromTopLeftCorner

▸ iterateValuesFromTopLeftCorner(): IterableIterator‹InternalScalarValue›

Defined in src/SimpleRangeValue.ts:151 (opens new window)

Generates the values of the cells contained in the range assuming the provided address is the left corner of the range.

Returns: IterableIterator‹InternalScalarValue›


# numberOfElements

▸ numberOfElements(): number

Defined in src/SimpleRangeValue.ts:158 (opens new window)

Returns the number of cells contained in the range.

Returns: number


# rawData

▸ rawData(): InternalScalarValue[][]

Defined in src/SimpleRangeValue.ts:196 (opens new window)

Returns the range data as a 2D array.

Internal use only.

Returns: InternalScalarValue[][]


# rawNumbers

▸ rawNumbers(): number[][]

Defined in src/SimpleRangeValue.ts:186 (opens new window)

Returns the range data as a 2D array of numbers.

Internal use only.

Returns: number[][]


# sameDimensionsAs

▸ sameDimensionsAs(other: SimpleRangeValue): boolean

Defined in src/SimpleRangeValue.ts:204 (opens new window)

Returns true if and only if the range has the same width and height as the other range object.

Parameters:

Name Type
other SimpleRangeValue

Returns: boolean


# valuesFromTopLeftCorner

▸ valuesFromTopLeftCorner(): InternalScalarValue[]

Defined in src/SimpleRangeValue.ts:109 (opens new window)

Returns the range data as a 1D array.

Returns: InternalScalarValue[]


# width

▸ width(): number

Defined in src/SimpleRangeValue.ts:95 (opens new window)

Returns the number of columns contained in the range.

Returns: number


# fromRange Static

▸ fromRange(data: InternalScalarValue[][], range: AbsoluteCellRange, dependencyGraph: DependencyGraph): SimpleRangeValue

Defined in src/SimpleRangeValue.ts:53 (opens new window)

A factory method. Returns a SimpleRangeValue object with the provided range address and the provided data.

Parameters:

Name Type
data InternalScalarValue[][]
range AbsoluteCellRange
dependencyGraph DependencyGraph

Returns: SimpleRangeValue


# fromScalar Static

▸ fromScalar(scalar: InternalScalarValue): SimpleRangeValue

Defined in src/SimpleRangeValue.ts:81 (opens new window)

A factory method. Returns a SimpleRangeValue object that contains a single value.

Parameters:

Name Type
scalar InternalScalarValue

Returns: SimpleRangeValue


# onlyNumbers Static

▸ onlyNumbers(data: number[][]): SimpleRangeValue

Defined in src/SimpleRangeValue.ts:60 (opens new window)

A factory method. Returns a SimpleRangeValue object with the provided numeric data.

Parameters:

Name Type
data number[][]

Returns: SimpleRangeValue


# onlyRange Static

▸ onlyRange(range: AbsoluteCellRange, dependencyGraph: DependencyGraph): SimpleRangeValue

Defined in src/SimpleRangeValue.ts:74 (opens new window)

A factory method. Returns a SimpleRangeValue object with the provided range address.

Parameters:

Name Type
range AbsoluteCellRange
dependencyGraph DependencyGraph

Returns: SimpleRangeValue


# onlyValues Static

▸ onlyValues(data: InternalScalarValue[][]): SimpleRangeValue

Defined in src/SimpleRangeValue.ts:67 (opens new window)

A factory method. Returns a SimpleRangeValue object with the provided data.

Parameters:

Name Type
data InternalScalarValue[][]

Returns: SimpleRangeValue