Class ELArithmetic

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ELArithmetic()
      Protected constructor for subclasses.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract java.lang.Number add​(java.lang.Number num0, java.lang.Number num1)
      Add two numbers.
      static java.lang.Number add​(java.lang.Object obj0, java.lang.Object obj1)
      Add two objects, coercing them to the appropriate numeric type.
      protected abstract java.lang.Number coerce​(java.lang.Number num)
      Coerce a number to the delegate's preferred type.
      protected java.lang.Number coerce​(java.lang.Object obj)
      Coerce an object to a number.
      protected abstract java.lang.Number coerce​(java.lang.String str)
      Coerce a string to a number.
      protected abstract java.lang.Number divide​(java.lang.Number num0, java.lang.Number num1)
      Divide two numbers.
      static java.lang.Number divide​(java.lang.Object obj0, java.lang.Object obj1)
      Divide two objects, coercing them to the appropriate numeric type.
      static boolean isNumber​(java.lang.Object obj)
      Check if the given object is a number.
      static boolean isNumberType​(java.lang.Class<?> type)
      Check if the given class is a number type.
      protected abstract boolean matches​(java.lang.Object obj0, java.lang.Object obj1)
      Check if this delegate matches the given operand types.
      protected abstract java.lang.Number mod​(java.lang.Number num0, java.lang.Number num1)
      Compute the modulo of two numbers.
      static java.lang.Number mod​(java.lang.Object obj0, java.lang.Object obj1)
      Compute the modulo of two objects, coercing them to the appropriate numeric type.
      protected abstract java.lang.Number multiply​(java.lang.Number num0, java.lang.Number num1)
      Multiply two numbers.
      static java.lang.Number multiply​(java.lang.Object obj0, java.lang.Object obj1)
      Multiply two objects, coercing them to the appropriate numeric type.
      protected abstract java.lang.Number subtract​(java.lang.Number num0, java.lang.Number num1)
      Subtract two numbers.
      static java.lang.Number subtract​(java.lang.Object obj0, java.lang.Object obj1)
      Subtract two objects, coercing them to the appropriate numeric type.
      • Methods inherited from class java.lang.Object

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

      • ELArithmetic

        protected ELArithmetic()
        Protected constructor for subclasses.
    • Method Detail

      • add

        public static java.lang.Number add​(java.lang.Object obj0,
                                           java.lang.Object obj1)
        Add two objects, coercing them to the appropriate numeric type.
        Parameters:
        obj0 - The first operand
        obj1 - The second operand
        Returns:
        The result of the addition
      • mod

        public static java.lang.Number mod​(java.lang.Object obj0,
                                           java.lang.Object obj1)
        Compute the modulo of two objects, coercing them to the appropriate numeric type.
        Parameters:
        obj0 - The dividend
        obj1 - The divisor
        Returns:
        The result of the modulo operation
      • subtract

        public static java.lang.Number subtract​(java.lang.Object obj0,
                                                java.lang.Object obj1)
        Subtract two objects, coercing them to the appropriate numeric type.
        Parameters:
        obj0 - The minuend
        obj1 - The subtrahend
        Returns:
        The result of the subtraction
      • divide

        public static java.lang.Number divide​(java.lang.Object obj0,
                                              java.lang.Object obj1)
        Divide two objects, coercing them to the appropriate numeric type.
        Parameters:
        obj0 - The dividend
        obj1 - The divisor
        Returns:
        The result of the division
      • multiply

        public static java.lang.Number multiply​(java.lang.Object obj0,
                                                java.lang.Object obj1)
        Multiply two objects, coercing them to the appropriate numeric type.
        Parameters:
        obj0 - The first factor
        obj1 - The second factor
        Returns:
        The result of the multiplication
      • isNumber

        public static boolean isNumber​(java.lang.Object obj)
        Check if the given object is a number.
        Parameters:
        obj - The object to check
        Returns:
        true if the object is a number
      • isNumberType

        public static boolean isNumberType​(java.lang.Class<?> type)
        Check if the given class is a number type.
        Parameters:
        type - The class to check
        Returns:
        true if the class is a number type
      • add

        protected abstract java.lang.Number add​(java.lang.Number num0,
                                                java.lang.Number num1)
        Add two numbers.
        Parameters:
        num0 - The first number
        num1 - The second number
        Returns:
        The sum
      • multiply

        protected abstract java.lang.Number multiply​(java.lang.Number num0,
                                                     java.lang.Number num1)
        Multiply two numbers.
        Parameters:
        num0 - The first number
        num1 - The second number
        Returns:
        The product
      • subtract

        protected abstract java.lang.Number subtract​(java.lang.Number num0,
                                                     java.lang.Number num1)
        Subtract two numbers.
        Parameters:
        num0 - The minuend
        num1 - The subtrahend
        Returns:
        The difference
      • mod

        protected abstract java.lang.Number mod​(java.lang.Number num0,
                                                java.lang.Number num1)
        Compute the modulo of two numbers.
        Parameters:
        num0 - The dividend
        num1 - The divisor
        Returns:
        The remainder
      • coerce

        protected abstract java.lang.Number coerce​(java.lang.Number num)
        Coerce a number to the delegate's preferred type.
        Parameters:
        num - The number to coerce
        Returns:
        The coerced number
      • coerce

        protected final java.lang.Number coerce​(java.lang.Object obj)
        Coerce an object to a number.
        Parameters:
        obj - The object to coerce
        Returns:
        The coerced number
      • coerce

        protected abstract java.lang.Number coerce​(java.lang.String str)
        Coerce a string to a number.
        Parameters:
        str - The string to coerce
        Returns:
        The coerced number
      • divide

        protected abstract java.lang.Number divide​(java.lang.Number num0,
                                                   java.lang.Number num1)
        Divide two numbers.
        Parameters:
        num0 - The dividend
        num1 - The divisor
        Returns:
        The quotient
      • matches

        protected abstract boolean matches​(java.lang.Object obj0,
                                           java.lang.Object obj1)
        Check if this delegate matches the given operand types.
        Parameters:
        obj0 - The first operand
        obj1 - The second operand
        Returns:
        true if this delegate should handle these types