Class ELArithmetic.LongDelegate

  • Enclosing class:
    ELArithmetic

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

      Constructors 
      Constructor Description
      LongDelegate()
      Construct a new LongDelegate.
    • Method Summary

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

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LongDelegate

        public LongDelegate()
        Construct a new LongDelegate.
    • Method Detail

      • add

        protected java.lang.Number add​(java.lang.Number num0,
                                       java.lang.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 java.lang.Number coerce​(java.lang.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 java.lang.Number coerce​(java.lang.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 java.lang.Number divide​(java.lang.Number num0,
                                          java.lang.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 java.lang.Number mod​(java.lang.Number num0,
                                       java.lang.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 java.lang.Number subtract​(java.lang.Number num0,
                                            java.lang.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 java.lang.Number multiply​(java.lang.Number num0,
                                            java.lang.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​(java.lang.Object obj0,
                               java.lang.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