org.shiftone.bigcalc.core.operation.binary
Class AbstractBinaryOperation

java.lang.Object
  extended byorg.shiftone.bigcalc.core.operation.binary.AbstractBinaryOperation
All Implemented Interfaces:
BinaryOperation
Direct Known Subclasses:
AddBinaryOperation, DivideBinaryOperation, MultiplyBinaryOperation, PowerBinaryOperation, SubtractBinaryOperation

public abstract class AbstractBinaryOperation
extends java.lang.Object
implements BinaryOperation


Constructor Summary
AbstractBinaryOperation()
           
 
Method Summary
protected  java.lang.Object calculateBigDecimals(Context stdContext, java.math.BigDecimal lhs, java.math.BigDecimal rhs)
           
protected  java.lang.Object calculateBigIntegers(Context stdContext, java.math.BigInteger lhs, java.math.BigInteger rhs)
           
protected  java.lang.Object calculateNonNumbers(Context stdContext, java.lang.Object lhs, java.lang.Object rhs)
           
protected  java.lang.Object calculateNumbers(Context stdContext, java.lang.Number lhs, java.lang.Number rhs)
           
 java.lang.Object evaluate(Context stdContext, java.lang.Object lhs, java.lang.Object rhs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.shiftone.bigcalc.core.operation.BinaryOperation
getSymbol
 

Constructor Detail

AbstractBinaryOperation

public AbstractBinaryOperation()
Method Detail

evaluate

public java.lang.Object evaluate(Context stdContext,
                                 java.lang.Object lhs,
                                 java.lang.Object rhs)
                          throws java.lang.Exception
Specified by:
evaluate in interface BinaryOperation
Throws:
java.lang.Exception

calculateNumbers

protected java.lang.Object calculateNumbers(Context stdContext,
                                            java.lang.Number lhs,
                                            java.lang.Number rhs)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

calculateNonNumbers

protected java.lang.Object calculateNonNumbers(Context stdContext,
                                               java.lang.Object lhs,
                                               java.lang.Object rhs)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

calculateBigDecimals

protected java.lang.Object calculateBigDecimals(Context stdContext,
                                                java.math.BigDecimal lhs,
                                                java.math.BigDecimal rhs)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

calculateBigIntegers

protected java.lang.Object calculateBigIntegers(Context stdContext,
                                                java.math.BigInteger lhs,
                                                java.math.BigInteger rhs)
                                         throws java.lang.Exception
Throws:
java.lang.Exception