# Package com.singularsys.jep.misc.nullwrapper

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

- Related Packages
  Package
  Description
  com.singularsys.jep.misc
  Miscellaneous components.
  com.singularsys.jep.misc.nullwrapper.functions
  Null wrapped versions of specific functions.
- Class
  Description
  NullWrappedFunctionFactory
  A factory to create the appropriate type of wrapped function.
  NullWrappedFunctionTable
  A function table which wraps all the functions in an existing table.
  NullWrappedOperatorTable
  An operator table where the operators generally return null if either argument is null.
  NullWrappedOperatorTable.NullWrapperOperators
  Key for the one operator NullSafeEquals added by the table.