# SimpleRangeValue

A class that represents a range of data.

## Constructors

### constructor 

\+ **new SimpleRangeValue**(`_data?`: InternalScalarValue[][], `range?`: [AbsoluteCellRange](absolutecellrange.md), `dependencyGraph?`: DependencyGraph, `_hasOnlyNumbers?`: undefined | false | true, `readCellValue?`: undefined | function): *[SimpleRangeValue](simplerangevalue.md)*

*Defined in [src/SimpleRangeValue.ts:21](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L21)*

In most cases, it's more convenient to create a `SimpleRangeValue` object
by calling one of the [static factory methods](#fromrange).

**Parameters:**

Name | Type |
------ | ------ |
`_data?` | InternalScalarValue[][] |
`range?` | [AbsoluteCellRange](absolutecellrange.md) |
`dependencyGraph?` | DependencyGraph |
`_hasOnlyNumbers?` | undefined &#124; false &#124; true |
`readCellValue?` | undefined &#124; function |

**Returns:** *[SimpleRangeValue](simplerangevalue.md)*

## Properties

### range

• **range**? : *[AbsoluteCellRange](absolutecellrange.md)*

*Defined in [src/SimpleRangeValue.ts:33](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L33)*

A property that represents the address of the range.

___

### size

• **size**: *[ArraySize](arraysize.md)*

*Defined in [src/SimpleRangeValue.ts:21](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L21)*

A property that represents the size of the range.

## Accessors

### data 

• **get data**(): *InternalScalarValue[][]*

*Defined in [src/SimpleRangeValue.ts:46](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L46)*

Returns the range data as a 2D array.

**Returns:** *InternalScalarValue[][]*

## Methods

### effectiveAddressesFromData 

▸ **effectiveAddressesFromData**(`leftCorner`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *IterableIterator‹[SimpleCellAddress](../interfaces/simplecelladdress.md)›*

*Defined in [src/SimpleRangeValue.ts:138](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L138)*

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](../interfaces/simplecelladdress.md) |

**Returns:** *IterableIterator‹[SimpleCellAddress](../interfaces/simplecelladdress.md)›*

___

### entriesFromTopLeftCorner 

▸ **entriesFromTopLeftCorner**(`leftCorner`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *IterableIterator‹[InternalScalarValue, [SimpleCellAddress](../interfaces/simplecelladdress.md)]›*

*Defined in [src/SimpleRangeValue.ts:152](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L152)*

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()`](#iteratevaluesfromtopleftcorner) and [`effectiveAddressesFromData()`](#effectiveaddressesfromdata).

**Parameters:**

Name | Type |
------ | ------ |
`leftCorner` | [SimpleCellAddress](../interfaces/simplecelladdress.md) |

**Returns:** *IterableIterator‹[InternalScalarValue, [SimpleCellAddress](../interfaces/simplecelladdress.md)]›*

___

### hasOnlyNumbers 

▸ **hasOnlyNumbers**(): *boolean*

*Defined in [src/SimpleRangeValue.ts:178](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L178)*

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

**Returns:** *boolean*

___

### hasValueReader 

▸ **hasValueReader**(): *boolean*

*Defined in [src/SimpleRangeValue.ts:101](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L101)*

Returns whether this reference must use its reader to obtain current cell values.

**Returns:** *boolean*

___

### height 

▸ **height**(): *number*

*Defined in [src/SimpleRangeValue.ts:115](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L115)*

Returns the number of rows contained in the range.

**Returns:** *number*

___

### isAdHoc 

▸ **isAdHoc**(): *boolean*

*Defined in [src/SimpleRangeValue.ts:96](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L96)*

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

**Returns:** *boolean*

___

### iterateValuesFromTopLeftCorner 

▸ **iterateValuesFromTopLeftCorner**(): *IterableIterator‹InternalScalarValue›*

*Defined in [src/SimpleRangeValue.ts:164](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L164)*

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:171](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L171)*

Returns the number of cells contained in the range.

**Returns:** *number*

___

### rawData 

▸ **rawData**(): *InternalScalarValue[][]*

*Defined in [src/SimpleRangeValue.ts:209](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L209)*

Returns the range data as a 2D array.

Internal use only.

**Returns:** *InternalScalarValue[][]*

___

### rawNumbers 

▸ **rawNumbers**(): *number[][]*

*Defined in [src/SimpleRangeValue.ts:199](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L199)*

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

Internal use only.

**Returns:** *number[][]*

___

### sameDimensionsAs 

▸ **sameDimensionsAs**(`other`: [SimpleRangeValue](simplerangevalue.md)): *boolean*

*Defined in [src/SimpleRangeValue.ts:217](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L217)*

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

**Parameters:**

Name | Type |
------ | ------ |
`other` | [SimpleRangeValue](simplerangevalue.md) |

**Returns:** *boolean*

___

### valuesFromTopLeftCorner 

▸ **valuesFromTopLeftCorner**(): *InternalScalarValue[]*

*Defined in [src/SimpleRangeValue.ts:122](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L122)*

Returns the range data as a 1D array.

**Returns:** *InternalScalarValue[]*

___

### width 

▸ **width**(): *number*

*Defined in [src/SimpleRangeValue.ts:108](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L108)*

Returns the number of columns contained in the range.

**Returns:** *number*

___

### fromRange

▸ **fromRange**(`data`: InternalScalarValue[][], `range`: [AbsoluteCellRange](absolutecellrange.md), `dependencyGraph`: DependencyGraph): *[SimpleRangeValue](simplerangevalue.md)*

*Defined in [src/SimpleRangeValue.ts:54](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L54)*

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

**Parameters:**

Name | Type |
------ | ------ |
`data` | InternalScalarValue[][] |
`range` | [AbsoluteCellRange](absolutecellrange.md) |
`dependencyGraph` | DependencyGraph |

**Returns:** *[SimpleRangeValue](simplerangevalue.md)*

___

### fromScalar

▸ **fromScalar**(`scalar`: InternalScalarValue): *[SimpleRangeValue](simplerangevalue.md)*

*Defined in [src/SimpleRangeValue.ts:89](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L89)*

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

**Parameters:**

Name | Type |
------ | ------ |
`scalar` | InternalScalarValue |

**Returns:** *[SimpleRangeValue](simplerangevalue.md)*

___

### onlyNumbers

▸ **onlyNumbers**(`data`: number[][]): *[SimpleRangeValue](simplerangevalue.md)*

*Defined in [src/SimpleRangeValue.ts:61](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L61)*

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

**Parameters:**

Name | Type |
------ | ------ |
`data` | number[][] |

**Returns:** *[SimpleRangeValue](simplerangevalue.md)*

___

### onlyRange

▸ **onlyRange**(`range`: [AbsoluteCellRange](absolutecellrange.md), `dependencyGraph`: DependencyGraph): *[SimpleRangeValue](simplerangevalue.md)*

*Defined in [src/SimpleRangeValue.ts:75](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L75)*

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

**Parameters:**

Name | Type |
------ | ------ |
`range` | [AbsoluteCellRange](absolutecellrange.md) |
`dependencyGraph` | DependencyGraph |

**Returns:** *[SimpleRangeValue](simplerangevalue.md)*

___

### onlyRangeWithValueReader

▸ **onlyRangeWithValueReader**(`range`: [AbsoluteCellRange](absolutecellrange.md), `dependencyGraph`: DependencyGraph, `readCellValue`: function): *[SimpleRangeValue](simplerangevalue.md)*

*Defined in [src/SimpleRangeValue.ts:82](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L82)*

Keeps a resolved reference lazy until a value consumer requests its contents.

**Parameters:**

▪ **range**: *[AbsoluteCellRange](absolutecellrange.md)*

▪ **dependencyGraph**: *DependencyGraph*

▪ **readCellValue**: *function*

▸ (`address`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *InterpreterValue*

**Parameters:**

Name | Type |
------ | ------ |
`address` | [SimpleCellAddress](../interfaces/simplecelladdress.md) |

**Returns:** *[SimpleRangeValue](simplerangevalue.md)*

___

### onlyValues

▸ **onlyValues**(`data`: InternalScalarValue[][]): *[SimpleRangeValue](simplerangevalue.md)*

*Defined in [src/SimpleRangeValue.ts:68](https://github.com/handsontable/hyperformula/blob/8e5cde3/src/SimpleRangeValue.ts#L68)*

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

**Parameters:**

Name | Type |
------ | ------ |
`data` | InternalScalarValue[][] |

**Returns:** *[SimpleRangeValue](simplerangevalue.md)*