ELArithmetic.LongDelegate (Apache Tomcat 11.0.23 API Documentation)
Description: declaration: package: org.apache.el.lang, class: ELArithmetic, class: LongDelegate

# Class ELArithmetic.LongDelegate

java.lang.Object
org.apache.el.lang.ELArithmetic
org.apache.el.lang.ELArithmetic.LongDelegate

Enclosing class:
  `ELArithmetic`

public static final class ELArithmetic.LongDelegate extends ELArithmetic
Arithmetic delegate for long/integer operations.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class ELArithmetic

  `ELArithmetic.BigDecimalDelegate, ELArithmetic.BigIntegerDelegate, ELArithmetic.DoubleDelegate, ELArithmetic.LongDelegate`

- ## Field Summary

  ### Fields inherited from class ELArithmetic

  `BIGDECIMAL, BIGINTEGER, DOUBLE, LONG`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LongDelegate()`
  Construct a new LongDelegate.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Number`
  `add(Number num0, Number num1)`
  Add two numbers.
  `protected Number`
  `coerce(Number num)`
  Coerce a number to the delegate's preferred type.
  `protected Number`
  `coerce(String str)`
  Coerce a string to a number.
  `protected Number`
  `divide(Number num0, Number num1)`
  Divide two numbers.
  `boolean`
  `matches(Object obj0, Object obj1)`
  Check if this delegate matches the given operand types.
  `protected Number`
  `mod(Number num0, Number num1)`
  Compute the modulo of two numbers.
  `protected Number`
  `multiply(Number num0, Number num1)`
  Multiply two numbers.
  `protected Number`
  `subtract(Number num0, Number num1)`
  Subtract two numbers.

  ### Methods inherited from class ELArithmetic

  `add, coerce, divide, isNumber, isNumberType, mod, multiply, subtract`

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### LongDelegate

    public LongDelegate()
    Construct a new LongDelegate.

- ## Method Details

  - ### add

    protected Number add(Number num0, Number num1)
    Description copied from class: `ELArithmetic`
    Add two numbers.
    Specified by:
      `add` in class `ELArithmetic`
    Parameters:
      `num0` - The first number
      `num1` - The second number
    Returns:
      The sum

  - ### coerce

    protected Number coerce(Number num)
    Description copied from class: `ELArithmetic`
    Coerce a number to the delegate's preferred type.
    Specified by:
      `coerce` in class `ELArithmetic`
    Parameters:
      `num` - The number to coerce
    Returns:
      The coerced number

  - ### coerce

    protected Number coerce(String str)
    Description copied from class: `ELArithmetic`
    Coerce a string to a number.
    Specified by:
      `coerce` in class `ELArithmetic`
    Parameters:
      `str` - The string to coerce
    Returns:
      The coerced number

  - ### divide

    protected Number divide(Number num0, Number num1)
    Description copied from class: `ELArithmetic`
    Divide two numbers.
    Specified by:
      `divide` in class `ELArithmetic`
    Parameters:
      `num0` - The dividend
      `num1` - The divisor
    Returns:
      The quotient

  - ### mod

    protected Number mod(Number num0, Number num1)
    Description copied from class: `ELArithmetic`
    Compute the modulo of two numbers.
    Specified by:
      `mod` in class `ELArithmetic`
    Parameters:
      `num0` - The dividend
      `num1` - The divisor
    Returns:
      The remainder

  - ### subtract

    protected Number subtract(Number num0, Number num1)
    Description copied from class: `ELArithmetic`
    Subtract two numbers.
    Specified by:
      `subtract` in class `ELArithmetic`
    Parameters:
      `num0` - The minuend
      `num1` - The subtrahend
    Returns:
      The difference

  - ### multiply

    protected Number multiply(Number num0, Number num1)
    Description copied from class: `ELArithmetic`
    Multiply two numbers.
    Specified by:
      `multiply` in class `ELArithmetic`
    Parameters:
      `num0` - The first number
      `num1` - The second number
    Returns:
      The product

  - ### matches

    public boolean matches(Object obj0, Object obj1)
    Description copied from class: `ELArithmetic`
    Check if this delegate matches the given operand types.
    Specified by:
      `matches` in class `ELArithmetic`
    Parameters:
      `obj0` - The first operand
      `obj1` - The second operand
    Returns:
      true if this delegate should handle these types