# 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): *[SimpleRangeValue](simplerangevalue.md)*

*Defined in [hyperformula/src/SimpleRangeValue.ts:29](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L29)*

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 |

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

## Properties

### size

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

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

A property that represents the size of the range.

## Accessors

### data

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:78](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L78)*

Returns the range data as a 2D array.

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

___

### range

• **get range**(): *[AbsoluteCellRange](absolutecellrange.md) | undefined*

*Defined in [hyperformula/src/SimpleRangeValue.ts:50](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L50)*

A property that represents the address of the range.

**Returns:** *[AbsoluteCellRange](absolutecellrange.md) | undefined*

## Methods

### effectiveAddressesFromData

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:171](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L171)*

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 [hyperformula/src/SimpleRangeValue.ts:185](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L185)*

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 [hyperformula/src/SimpleRangeValue.ts:211](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L211)*

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

**Returns:** *boolean*

___

### height

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:148](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L148)*

Returns the number of rows contained in the range.

**Returns:** *number*

___

### isAdHoc

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:134](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L134)*

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

**Returns:** *boolean*

___

### iterateValuesFromTopLeftCorner

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:197](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L197)*

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 [hyperformula/src/SimpleRangeValue.ts:204](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L204)*

Returns the number of cells contained in the range.

**Returns:** *number*

___

### rawData

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:242](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L242)*

Returns the range data as a 2D array.

Internal use only.

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

___

### rawNumbers

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:232](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L232)*

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

Internal use only.

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

___

### sameDimensionsAs

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:250](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L250)*

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 [hyperformula/src/SimpleRangeValue.ts:155](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L155)*

Returns the range data as a 1D array.

**Returns:** *InternalScalarValue[]*

___

### width

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:141](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L141)*

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 [hyperformula/src/SimpleRangeValue.ts:86](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L86)*

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 [hyperformula/src/SimpleRangeValue.ts:127](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L127)*

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 [hyperformula/src/SimpleRangeValue.ts:93](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L93)*

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 [hyperformula/src/SimpleRangeValue.ts:107](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L107)*

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)*

___

### onlyValues

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:100](https://github.com/handsontable/hyperformula/blob/9bc918c/hyperformula/src/SimpleRangeValue.ts#L100)*

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

**Parameters:**

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

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