csheets.core.formula.lang
Class Adder

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

public class Adder
extends Object
implements BinaryOperator

An adder.

Author:
Einar Pehrson
See Also:
Serialized Form

Constructor Summary
Adder()
          Creates a new adder.
 
Method Summary
 Value applyTo(Expression leftOperand, Expression rightOperand)
          Applies the operator to the given operands and returns the result.
 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

Adder

public Adder()
Creates a new adder.

Method Detail

applyTo

public Value applyTo(Expression leftOperand,
                     Expression rightOperand)
              throws IllegalValueTypeException
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
Throws:
IllegalValueTypeException - if the value of an operand is not of the expected type

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