Package com.singularsys.jep.misc.nullwrapper.functions

# Class NullWrappedUnary

java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.UnaryFunction
com.singularsys.jep.misc.nullwrapper.functions.NullWrappedUnary

All Implemented Interfaces:
  `NullWrappedFunctionI`, `PostfixMathCommandI`, `Serializable`

public class NullWrappedUnary extends UnaryFunction implements NullWrappedFunctionI
Null wrapped version of a unary function. `fun(null)` will return null

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

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class com.singularsys.jep.functions.UnaryFunction

  `UnaryFunction.FunctionWithException<T>`

- ## Field Summary

  ### Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand

  `curNumberOfParameters, description, name, NaN, numberOfParameters`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NullWrappedUnary(UnaryFunction fun)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `eval(Object arg)`
  Evaluate the function
  `String`
  `getDescription()`
  Return a description of the function from the properties file.
  `PostfixMathCommandI`
  `getRoot()`
  Get to function which this function wraps.
  `void`
  `setName(String name)`
  Sets the name of the function used for error messages

  ### Methods inherited from class com.singularsys.jep.functions.UnaryFunction

  `instanceOf, instanceOf, instanceOf, instanceOf, run`

  ### Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand

  `asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, checkNumberOfParameters, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, toString, toString`

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

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

- ## Constructor Details

  - ### NullWrappedUnary

    public NullWrappedUnary(UnaryFunction fun)
    Parameters:
      `fun` -

- ## Method Details

  - ### getRoot

    public PostfixMathCommandI getRoot()
    Description copied from interface: `NullWrappedFunctionI`
    Get to function which this function wraps.
    Specified by:
      `getRoot` in interface `NullWrappedFunctionI`
    Returns:
      the root function, may be "this".

  - ### setName

    public void setName(String name)
    Description copied from interface: `PostfixMathCommandI`
    Sets the name of the function used for error messages
    Specified by:
      `setName` in interface `PostfixMathCommandI`
    Overrides:
      `setName` in class `PostfixMathCommand`
    Parameters:
      `name` - the function name

  - ### eval

    public Object eval(Object arg) throws EvaluationException
    Description copied from class: `UnaryFunction`
    Evaluate the function
    Specified by:
      `eval` in class `UnaryFunction`
    Parameters:
      `arg` - the single argument passed in
    Returns:
      the result of the function
    Throws:
      `EvaluationException` - on error

  - ### getDescription

    public String getDescription()
    Description copied from class: `PostfixMathCommand`
    Return a description of the function from the properties file. The property name is the class name followed by ".description". The property is found using the `JepMessages` class, which can be configured to add additional properties files. If `PostfixMathCommand.setDescription(String)` has been called, return the description set by that method instead.
    Specified by:
      `getDescription` in interface `PostfixMathCommandI`
    Overrides:
      `getDescription` in class `PostfixMathCommand`
    Returns:
      the description of the function