csheets.core.formula
Interface Reference

All Superinterfaces:
Comparable<Reference>, Expression, Serializable
All Known Implementing Classes:
CellReference, ReferenceOperation

public interface Reference
extends Expression, Comparable<Reference>

A reference to one or more cells in a spreadsheet.

Author:
Einar Pehrson

Method Summary
 int compareTo(Reference reference)
          Compares the reference with the given reference for order.
 Value evaluate()
          Evaluates the expression and returns the result.
 SortedSet<Cell> getCells()
          Returns the cell addresses (or address) that the reference points to.
 
Methods inherited from interface csheets.core.formula.Expression
accept
 

Method Detail

evaluate

Value evaluate()
Description copied from interface: Expression
Evaluates the expression and returns the result.

Specified by:
evaluate in interface Expression
Returns:
the result of the evaluation

getCells

SortedSet<Cell> getCells()
Returns the cell addresses (or address) that the reference points to.

Returns:
a naturally ordered set of the references' addresses

compareTo

int compareTo(Reference reference)
Compares the reference with the given reference for order.

Specified by:
compareTo in interface Comparable<Reference>
Parameters:
reference - the reference to be compared
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.