org.axiondb.functions
Class ArithmeticFunction

java.lang.Object
  extended by org.axiondb.BaseSelectable
      extended by org.axiondb.functions.BaseFunction
          extended by org.axiondb.functions.ArithmeticFunction
All Implemented Interfaces:
Serializable, Function, ConcreteFunction, ScalarFunction, Selectable
Direct Known Subclasses:
AddFunction, DivideFunction, MultiplyFunction, SubtractFunction

public abstract class ArithmeticFunction
extends BaseFunction
implements ScalarFunction

Version:
$Revision: 1.9 $ $Date: 2005/12/20 18:32:28 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.axiondb.BaseSelectable
_hash
 
Constructor Summary
ArithmeticFunction(String name)
           
 
Method Summary
 Object evaluate(RowDecorator row)
           
 DataType getDataType()
           
 boolean isValid()
           
protected abstract  BigDecimal operate(BigDecimal left, BigDecimal right)
           
protected  void setDataType(DataType newType)
           
 
Methods inherited from class org.axiondb.functions.BaseFunction
addArgument, getArgument, getArgumentCount, setArgument, setVariableContext, toString
 
Methods inherited from class org.axiondb.BaseSelectable
getAlias, getLabel, getName, setAlias, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.axiondb.Function
addArgument, getAlias, getArgument, getArgumentCount, getName, setAlias, setArgument
 
Methods inherited from interface org.axiondb.Selectable
getLabel, setVariableContext
 

Constructor Detail

ArithmeticFunction

public ArithmeticFunction(String name)
Method Detail

getDataType

public final DataType getDataType()
Specified by:
getDataType in interface Selectable
Specified by:
getDataType in class BaseFunction

evaluate

public final Object evaluate(RowDecorator row)
                      throws AxionException
Specified by:
evaluate in interface ScalarFunction
Specified by:
evaluate in interface Selectable
Throws:
AxionException

isValid

public final boolean isValid()
Specified by:
isValid in interface ConcreteFunction
Specified by:
isValid in class BaseFunction

operate

protected abstract BigDecimal operate(BigDecimal left,
                                      BigDecimal right)
                               throws AxionException
Throws:
AxionException

setDataType

protected void setDataType(DataType newType)