csheets.core.formula.lang
Class RangeReference

java.lang.Object
  extended by csheets.core.formula.lang.RangeReference
All Implemented Interfaces:
BinaryOperator, Operator, Serializable

public class RangeReference
extends Object
implements BinaryOperator

A reference to a range of cells in a spreadsheet.

Author:
Einar Pehrson
See Also:
Serialized Form

Constructor Summary
RangeReference()
          Creates a new range reference operator.
 
Method Summary
 Value applyTo(Expression leftOperand, Expression rightOperand)
          Applies the operator to the given operands and returns the result.
 Cell[][] getCells(Reference reference1, Reference reference2)
          Returns the range of cells formed by the two cell references.
 String getIdentifier()
          Returns the operator's string identirifer.
 Value.Type getOperandValueType()
          Returns the type of value that the operator's operands can have.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RangeReference

public RangeReference()
Creates a new range reference operator.

Method Detail

applyTo

public Value applyTo(Expression leftOperand,
                     Expression rightOperand)
Description copied from interface: BinaryOperator
Applies the operator to the given operands and returns the result.

Specified by:
applyTo in interface BinaryOperator
Returns:
the result of the operation

getCells

public Cell[][] getCells(Reference reference1,
                         Reference reference2)
Returns the range of cells formed by the two cell references.

Parameters:
reference1 - the first reference
reference2 - the other reference
Returns:
an array of the cells that constitute the range

getIdentifier

public String getIdentifier()
Description copied from interface: Operator
Returns the operator's string identirifer.

Specified by:
getIdentifier in interface Operator
Returns:
a string representation of the operator.

getOperandValueType

public Value.Type getOperandValueType()
Description copied from interface: Operator
Returns the type of value that the operator's operands can have.

Specified by:
getOperandValueType in interface Operator
Returns:
the type of value that the operator's operands can have

toString

public String toString()
Overrides:
toString in class Object