Package com.singularsys.jep.misc.nullwrapper

# Class NullWrappedFunctionTable

java.lang.Object
com.singularsys.jep.FunctionTable
com.singularsys.jep.misc.nullwrapper.NullWrappedFunctionTable

All Implemented Interfaces:
  `JepComponent`, `Serializable`

public class NullWrappedFunctionTable extends FunctionTable
A function table which wraps all the functions in an existing table.

Since:
  3.4
Author:
  Richard Morris
See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class com.singularsys.jep.FunctionTable

  `table`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  ``
  `NullWrappedFunctionTable(FunctionTable root)`
  Create a new function table which wraps all the functions in the original table.
  ``
  `NullWrappedFunctionTable(FunctionTable root, NullWrappedFunctionFactory factory)`
  A table where a specific NullWrapperFunctionFactory is defined.
  `protected`
  `NullWrappedFunctionTable(FunctionTable root, NullWrappedFunctionFactory factory, Map<String,PostfixMathCommandI> tbl)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `PostfixMathCommandI`
  `addFunction(String name, PostfixMathCommandI pfmc)`
  Add a function to the table.
  `FunctionTable`
  `shallowCopy()`
  Returns a new shallow copy of this function table.

  ### Methods inherited from class com.singularsys.jep.FunctionTable

  `addFunctionIfSet, clear, containsKey, containsValue, copyFunctionsFrom, entrySet, getFunction, getLightWeightInstance, init, isEmpty, keySet, remove, size, threadSafeMapCopy, toString, values`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### NullWrappedFunctionTable

    public NullWrappedFunctionTable(FunctionTable root)
    Create a new function table which wraps all the functions in the original table. For each function in the original it will first call `NullWrappedFunctionFactory.getWrappedFunction(PostfixMathCommandI)` to find the appropriate function.
    Parameters:
      `root` - the original table

  - ### NullWrappedFunctionTable

    protected NullWrappedFunctionTable(FunctionTable root, NullWrappedFunctionFactory factory, Map<String,PostfixMathCommandI> tbl)

  - ### NullWrappedFunctionTable

    public NullWrappedFunctionTable(FunctionTable root, NullWrappedFunctionFactory factory)
    A table where a specific NullWrapperFunctionFactory is defined.
    Parameters:
      `root` -
      `factory` -

- ## Method Details

  - ### addFunction

    public PostfixMathCommandI addFunction(String name, PostfixMathCommandI pfmc)
    Description copied from class: `FunctionTable`
    Add a function to the table.
    Overrides:
      `addFunction` in class `FunctionTable`
    Parameters:
      `name` - name of the function
      `pfmc` - the implementation of the function
    Returns:
      the previous function with the same name or null if none

  - ### shallowCopy

    public FunctionTable shallowCopy()
    Description copied from class: `FunctionTable`
    Returns a new shallow copy of this function table. Calls the `FunctionTable.threadSafeMapCopy()` method to ensure the table is safe to use a separate thread. All subclasses should override this method to create a function table of the matching type. A typical implementation would be

         @Override
         public FunctionTable shallowCopy() {
             Map<String,PostfixMathCommandI> newMap = this.threadSafeMapCopy();
             return new myFunctionTable(newMap);
         }

    using the `FunctionTable.threadSafeMapCopy()` method to return a copy of the map of functions and a constructor taking this map which uses the `FunctionTable(Map)` constructor.
    Overrides:
      `shallowCopy` in class `FunctionTable`
    Returns:
      a new shallow copy of this function table