csheets.core.formula.lang
Class Percent

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

public class Percent
extends Object
implements UnaryOperator

A percent operator (division by 100).

Author:
Einar Pehrson
See Also:
Serialized Form

Constructor Summary
Percent()
          Creates a new percent operator.
 
Method Summary
 Value applyTo(Expression operand)
          Returns the operand's value divided by 100.
 String getIdentifier()
          Returns the operator's string identirifer.
 Value.Type getOperandValueType()
          Returns the type of value that the operator's operands can have.
 boolean isPrefix()
          Returns whether the operator is a prefix operator, i.e. it appears before its operand.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Percent

public Percent()
Creates a new percent operator.

Method Detail

applyTo

public Value applyTo(Expression operand)
              throws IllegalValueTypeException
Returns the operand's value divided by 100.

Specified by:
applyTo in interface UnaryOperator
Returns:
the operand's value divided by 100
Throws:
IllegalValueTypeException - if the value of the operand is not numeric

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.

isPrefix

public boolean isPrefix()
Description copied from interface: UnaryOperator
Returns whether the operator is a prefix operator, i.e. it appears before its operand.

Specified by:
isPrefix in interface UnaryOperator
Returns:
true for prefix operators, false for postfix operators

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