Skip navigation links

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.

See: Description

Package com.singularsys.jep.misc.nullwrapper Description

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

A OR B True False null
True True True True
False True False null
null True null null

 

A AND B True False null
True True False null
False False False False
null null False null

 

A NOT A
True False
False True
null null
Skip navigation links

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