com.singularsys.jep.bigdecimal.functions

## Class BigDecRelational

- java.lang.Object
- - com.singularsys.jep.functions.PostfixMathCommand
  - - com.singularsys.jep.functions.BinaryFunction
    - - com.singularsys.jep.functions.Comparative
      - - com.singularsys.jep.bigdecimal.functions.BigDecRelational

- All Implemented Interfaces:
    PostfixMathCommandI, java.io.Serializable
  Direct Known Subclasses:
    BigDecTieBreakComparative

      public class BigDecRelational
      extends Comparative

  Implements the relational operations <, >, <=, >=, != and ==. BigDecimals can be compared to each other. Boolean values can be compared to each other. If the allowStrings option is set then Strings can be compared to each other. An illegal parameter exception is thrown if BigDecimals and Booleans or BigDecimals and Strings or Booleans and Strings are compared.
  Version:
    5.3 Now extends Comparative so can be used in MinMax
  Author:
    N Funk
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `id`

    - ### Fields inherited from class com.singularsys.jep.functions.Comparative

      `EQ, GE, GT, LE, LT, NE`

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

      `curNumberOfParameters, name, NaN, numberOfParameters`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BigDecRelational(int id_in)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `compare(java.lang.Object l, java.lang.Object r)`
    `java.lang.Object` | `eval(java.lang.Object l, java.lang.Object r)`
    `boolean` | `getAllowStrings()` Whether comparing strings is allowed.
    `void` | `setAllowStrings(boolean allowStrings)` Sets whether comparing strings is allowed.

    - ### Methods inherited from class com.singularsys.jep.functions.Comparative

      `eq, ge, getId, getTolerance, gt, le, lt, ne, setTolerance`

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

      `run`

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

      `asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, checkNumberOfParameters, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString, toString`

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

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

- - ### Field Detail

    - #### id

          protected int id

  - ### Constructor Detail

    - #### BigDecRelational

          public BigDecRelational(int id_in)

      Constructor. Sets the number of parameters to 2.
      Parameters:
        `id_in` - The id of the comparative operator.

  - ### Method Detail

    - #### compare

          public boolean compare(java.lang.Object l,
                                 java.lang.Object r)
                          throws EvaluationException

      Overrides:
        `compare` in class `Comparative`
      Throws:
        `EvaluationException`

    - #### eval

          public java.lang.Object eval(java.lang.Object l,
                                       java.lang.Object r)
                                throws EvaluationException

      Overrides:
        `eval` in class `Comparative`
      Throws:
        `EvaluationException`

    - #### getAllowStrings

          public boolean getAllowStrings()

      Whether comparing strings is allowed.
      Returns:
        true if allowed
      Since:
        3.4.0

    - #### setAllowStrings

          public void setAllowStrings(boolean allowStrings)

      Sets whether comparing strings is allowed.
      Parameters:
        `allowStrings` - When true, strings are allowed. When false an IllegalParameterException is thrown during evaluation.
      Since:
        3.4.0

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