Package com.singularsys.jep.misc.functions

# Class ConstantFunction

java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NullaryFunction
com.singularsys.jep.misc.functions.ConstantFunction

All Implemented Interfaces:
  `PostfixMathCommandI`, `Serializable`

public class ConstantFunction extends NullaryFunction
Functions which always return a constant value.

Author:
  Richard Morris
See Also:
  - Serialized Form

- ## Nested Class Summary

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

  `NullaryFunction.SupplierWithException<T>`

- ## Field Summary

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

  `curNumberOfParameters, description, name, NaN, numberOfParameters`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConstantFunction(Object value)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `eval()`
  Evaluate the function
  `String`
  `getDescription()`
  Return a description of the function from the properties file.
  `Object`
  `getValue()`

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

  `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, setName, toString, toString`

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

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

- ## Constructor Details

  - ### ConstantFunction

    public ConstantFunction(Object value)
    Parameters:
      `value` - the value returned by the function

- ## Method Details

  - ### eval

    public Object eval()
    Description copied from class: `NullaryFunction`
    Evaluate the function
    Specified by:
      `eval` in class `NullaryFunction`
    Returns:
      value of the function

  - ### getValue

    public Object getValue()

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