Package com.singularsys.jep.functions

# Class Logical

java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.BinaryFunction
com.singularsys.jep.functions.Logical

All Implemented Interfaces:
  `PostfixMathCommandI`, `Serializable`

public class Logical extends BinaryFunction
Logical operators `AND` and `OR`. No longer used by default after having added LazyLogical in Jep 3.1.0.

See Also:
  - Serialized Form

- ## Nested Class Summary

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

  `BinaryFunction.BiFunctionWithException<T>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected boolean`
  `allowNumbers`
  `static final int`
  `AND`
  `static final int`
  `OR`

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

  `curNumberOfParameters, description, name, NaN, numberOfParameters`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Logical(int id_in)`
  Standard constructor, allows Boolean and Number arguments
  `Logical(int id, boolean disallowNumbers)`
  Constructor which restricts type of arguments.

- ## Method Summary

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

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

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

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

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

- ## Field Details

  - ### AND

    public static final int AND
    See Also:
      - Constant Field Values

  - ### OR

    public static final int OR
    See Also:
      - Constant Field Values

  - ### allowNumbers

    protected boolean allowNumbers

- ## Constructor Details

  - ### Logical

    public Logical(int id_in)
    Standard constructor, allows Boolean and Number arguments
    Parameters:
      `id_in` - either of the constants `AND` or `OR`.

  - ### Logical

    public Logical(int id, boolean disallowNumbers)
    Constructor which restricts type of arguments.
    Parameters:
      `id` - either of the constants `AND` or `OR`.
      `disallowNumbers` - if true Number arguments will raise exceptions, otherwise they are treated like the Standard constructor.

- ## Method Details

  - ### eval

    public Object eval(Object l, Object r) throws EvaluationException
    Description copied from class: `BinaryFunction`
    Evaluate the function
    Specified by:
      `eval` in class `BinaryFunction`
    Parameters:
      `l` - lhs argument
      `r` - rhs argument
    Returns:
      the results
    Throws:
      `EvaluationException` - if the function cannot be evaluated.

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