Package com.singularsys.jep.misc.nullwrapper

Package to allow the treatment of null values which propagate up through evaluation so that null op anything will be null for most operator. This is similar behaviour SQL with its three value logic. The package works by wrapping existing operators and functions in new operators and functions which will propagate null values.

To set up this functionality use

jep.setComponent(new NullWrappedOperatorTable((OperatorTable2) jep.getOperatorTable(),true));
jep.setComponent(new NullWrappedFunctionTable(jep.getFunctionTable()));
jep.setComponent(new StandardConfigurableParser());
((FastEvaluator) jep.getEvaluator()).setTrapNullValues(false);
((FastEvaluator)jep.getEvaluator()).setTrapUnsetValues(false);

This will include the standard set of operators and functions as well as a Null-safe equals operator <=>.

The logic operators are exceptions to the general rule, true || null

OR Truth table
A OR B True False null
True True True True
False True False null
null True null null

 

AND Truth table
A AND B True False null
True True False null
False False False False
null null False null

 

NOT truth table
A NOT A
True False
False True
null null