# 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/5368efa/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/5368efa/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:58](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L58)*

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/5368efa/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:150](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L150)*

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:164](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L164)*

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:190](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L190)*

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

**Returns:** *boolean*

___

### height 

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:127](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L127)*

Returns the number of rows contained in the range.

**Returns:** *number*

___

### isAdHoc 

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:113](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L113)*

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

**Returns:** *boolean*

___

### iterateValuesFromTopLeftCorner 

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:176](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L176)*

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:183](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L183)*

Returns the number of cells contained in the range.

**Returns:** *number*

___

### rawData 

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:221](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L221)*

Returns the range data as a 2D array.

Internal use only.

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

___

### rawNumbers 

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:211](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L211)*

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:229](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L229)*

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:134](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L134)*

Returns the range data as a 1D array.

**Returns:** *InternalScalarValue[]*

___

### width 

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

*Defined in [hyperformula/src/SimpleRangeValue.ts:120](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L120)*

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:66](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L66)*

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:106](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L106)*

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:73](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L73)*

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:87](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L87)*

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:80](https://github.com/handsontable/hyperformula/blob/5368efa/hyperformula/src/SimpleRangeValue.ts#L80)*

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

**Parameters:**

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

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