com.singularsys.jep.misc.nullwrapper
Class NullWrappingOperatorTable

java.lang.Object
  extended by com.singularsys.jep.EmptyOperatorTable
      extended by com.singularsys.jep.OperatorTable2
          extended by com.singularsys.jep.misc.nullwrapper.NullWrappingOperatorTable
All Implemented Interfaces:
JepComponent, OperatorTableI, java.io.Serializable

public class NullWrappingOperatorTable
extends OperatorTable2

An operator table where the operators generally return null if either argument is null.

Since:
3.4
Author:
Richard Morris
See Also:
NullSafeEquals, Serialized Form

Nested Class Summary
static class NullWrappingOperatorTable.NullWrapperOperators
           
 
Nested classes/interfaces inherited from class com.singularsys.jep.OperatorTable2
OperatorTable2.BasicOperators, OperatorTable2.PsudoOperators, OperatorTable2.SpecialOperators
 
Nested classes/interfaces inherited from class com.singularsys.jep.EmptyOperatorTable
EmptyOperatorTable.OperatorKey
 
Constructor Summary
NullWrappingOperatorTable(OperatorTable2 root, boolean hasNullSafeEquals)
          Create a new operator table which wraps all the existing operators in the original table.
 
Method Summary
protected  PostfixMathCommandI wrapSpecialOperators(EmptyOperatorTable.OperatorKey key, Operator op)
          Special handling for operators.
 
Methods inherited from class com.singularsys.jep.OperatorTable2
getAdd, getAnd, getAssign, getCross, getDivide, getDot, getEle, getEQ, getGE, getGT, getLE, getList, getLT, getMod, getMultiply, getNE, getNop, getNot, getOr, getPower, getRange, getSubtract, getUDivide, getUMinus, getUPlus
 
Methods inherited from class com.singularsys.jep.EmptyOperatorTable
addOperator, addOperator, appendOperator, entrySet, getKey, getLightWeightInstance, getNumOps, getOperator, getOperators, getOperatorsByName, getOperatorsBySymbol, init, insertOperator, keySet, removeOperator, removeOperator, replaceOperator, replaceOperator, setBinaryInverseOp, setDistributiveOver, setInverseOp, setPrecedenceTable, setRootOp, setStandardOperatorRelations, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullWrappingOperatorTable

public NullWrappingOperatorTable(OperatorTable2 root,
                                 boolean hasNullSafeEquals)
Create a new operator table which wraps all the existing operators in the original table. Calls wrapSpecialOperators or NullWrapperFunctionFactory to wrap the functions.

Parameters:
root - the original operator table
hasNullSafeEquals - if true adds a NullSafeEquals operator "<=>" to the table
Method Detail

wrapSpecialOperators

protected PostfixMathCommandI wrapSpecialOperators(EmptyOperatorTable.OperatorKey key,
                                                   Operator op)
Special handling for operators. This method wraps subclasses may want to wrap further operators.

Parameters:
key -
op -
Returns:
wrapped versions of special functions or null if no special handeling needed


Copyright © 2010 Singular Systems http://www.singularsys.com/jep