CellValue

Class responsible for wrapping formula expression. It contains calculated value of
the formula, an error if it has happened and cell references which indicates a relationship with regular
cells. This object uses physical cell coordinates.

Members

staticCellValue.STATE_COMPUTING

Computing state indicates cells under processing.

staticCellValue.STATE_OUT_OFF_DATE

Out of date state indicates cells ready for recomputing.

staticCellValue.STATE_UP_TO_DATE

Up to date state indicates cells with fresh computed value.

errorstring null

Error name.

precedentsArray

List of precedents cells.

statestring

Indicates cell state.

value*

Computed value.

Methods

addPrecedent(cellReference)

Add precedent cell to the collection.

Parameters:
Name Type Description
cellReference CellReference

Cell reference object.

clearPrecedents()

Clear all precedent cells.

getError(){string|null}

Get error name for this cell.

Returns: {string|null}

getPrecedents(){Array}

Get precedent cells.

Returns: {Array}

getValue(){*}

Get computed value.

Returns: {*}

hasError(){boolean}

Check if cell value is marked as error.

Returns: {boolean}

hasPrecedent(cellReference){boolean}

Check if cell reference is precedents this cell.

Parameters:
Name Type Description
cellReference CellReference

Cell reference object.

Returns: {boolean}

hasPrecedents(){boolean}

Check if cell value has precedents cells.

Returns: {boolean}

isState(state){boolean}

Check cell state.

Parameters:
Name Type Description
state number

The state to compare with.

Returns: {boolean}

removePrecedent(cellReference)

Remove precedent cell from the collection.

Parameters:
Name Type Description
cellReference CellReference

Cell reference object.

setError(error)

Set error message for this cell.

Parameters:
Name Type Description
error string

Error name.

setState(state)

Set cell state.

Parameters:
Name Type Description
state number

Cell state.

setValue(value)

Set computed value.

Parameters:
Name Type Description
value *

The calculated formula value.

Class: CellValue