Class NumberType<T extends java.lang.Number>

    • Method Detail

      • isFloatingPoint

        public boolean isFloatingPoint()
        Checks if this type support floating point numbers.
        Returns:
        true if this type support floating point numbers, false otherwise.
      • toBigInteger

        protected java.math.BigInteger toBigInteger​(java.nio.ByteBuffer value)
        Converts the specified value into a BigInteger if allowed.
        Parameters:
        value - the value to convert
        Returns:
        the converted value
        Throws:
        java.lang.UnsupportedOperationException - if the value cannot be converted without losing precision
      • toBigDecimal

        protected java.math.BigDecimal toBigDecimal​(java.nio.ByteBuffer value)
        Converts the specified value into a BigDecimal.
        Parameters:
        value - the value to convert
        Returns:
        the converted value
      • toByte

        protected byte toByte​(java.nio.ByteBuffer value)
        Converts the specified value into a byte if allowed.
        Parameters:
        value - the value to convert
        Returns:
        the converted value
        Throws:
        java.lang.UnsupportedOperationException - if the value cannot be converted without losing precision
      • toShort

        protected short toShort​(java.nio.ByteBuffer value)
        Converts the specified value into a short if allowed.
        Parameters:
        value - the value to convert
        Returns:
        the converted value
        Throws:
        java.lang.UnsupportedOperationException - if the value cannot be converted without losing precision
      • toInt

        protected int toInt​(java.nio.ByteBuffer value)
        Converts the specified value into an int if allowed.
        Parameters:
        value - the value to convert
        Returns:
        the converted value
        Throws:
        java.lang.UnsupportedOperationException - if the value cannot be converted without losing precision
      • toLong

        protected long toLong​(java.nio.ByteBuffer value)
        Converts the specified value into a long if allowed.
        Parameters:
        value - the value to convert
        Returns:
        the converted value
        Throws:
        java.lang.UnsupportedOperationException - if the value cannot be converted without losing precision
      • toFloat

        protected float toFloat​(java.nio.ByteBuffer value)
        Converts the specified value into a float if allowed.
        Parameters:
        value - the value to convert
        Returns:
        the converted value
        Throws:
        java.lang.UnsupportedOperationException - if the value cannot be converted without losing precision
      • toDouble

        protected double toDouble​(java.nio.ByteBuffer value)
        Converts the specified value into a double if allowed.
        Parameters:
        value - the value to convert
        Returns:
        the converted value
        Throws:
        java.lang.UnsupportedOperationException - if the value cannot be converted without losing precision
      • add

        public abstract java.nio.ByteBuffer add​(NumberType<?> leftType,
                                                java.nio.ByteBuffer left,
                                                NumberType<?> rightType,
                                                java.nio.ByteBuffer right)
        Adds the left argument to the right one.
        Parameters:
        leftType - the type associated to the left argument
        left - the left argument
        rightType - the type associated to the right argument
        right - the right argument
        Returns:
        the addition result
      • substract

        public abstract java.nio.ByteBuffer substract​(NumberType<?> leftType,
                                                      java.nio.ByteBuffer left,
                                                      NumberType<?> rightType,
                                                      java.nio.ByteBuffer right)
        Substracts the left argument from the right one.
        Parameters:
        leftType - the type associated to the left argument
        left - the left argument
        rightType - the type associated to the right argument
        right - the right argument
        Returns:
        the substraction result
      • multiply

        public abstract java.nio.ByteBuffer multiply​(NumberType<?> leftType,
                                                     java.nio.ByteBuffer left,
                                                     NumberType<?> rightType,
                                                     java.nio.ByteBuffer right)
        Multiplies the left argument with the right one.
        Parameters:
        leftType - the type associated to the left argument
        left - the left argument
        rightType - the type associated to the right argument
        right - the right argument
        Returns:
        the multiplication result
      • divide

        public abstract java.nio.ByteBuffer divide​(NumberType<?> leftType,
                                                   java.nio.ByteBuffer left,
                                                   NumberType<?> rightType,
                                                   java.nio.ByteBuffer right)
        Divides the left argument by the right one.
        Parameters:
        leftType - the type associated to the left argument
        left - the left argument
        rightType - the type associated to the right argument
        right - the right argument
        Returns:
        the division result
      • mod

        public abstract java.nio.ByteBuffer mod​(NumberType<?> leftType,
                                                java.nio.ByteBuffer left,
                                                NumberType<?> rightType,
                                                java.nio.ByteBuffer right)
        Return the remainder.
        Parameters:
        leftType - the type associated to the left argument
        left - the left argument
        rightType - the type associated to the right argument
        right - the right argument
        Returns:
        the remainder
      • negate

        public abstract java.nio.ByteBuffer negate​(java.nio.ByteBuffer input)
        Negates the argument.
        Parameters:
        input - the argument to negate
        Returns:
        the negated argument