# 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

- Class Summary
  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.

- Enum Summary
  Enum | Description
  --- | ---
  NullWrappedOperatorTable.NullWrapperOperators | Key for the one operator NullSafeEquals added by the table.

## 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

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