Class MathType

  • All Implemented Interfaces:
    NumberType

    public class MathType
    extends ClassType
    implements NumberType
    This class represents the types java.math.BigDecimal and java.math.BigInteger.
    Version:
    0.1
    Author:
    Michael Bouschen
    • Constructor Detail

    • Method Detail

      • isOrderable

        public boolean isOrderable()
        A numeric wrapper class type defines an ordering.
        Overrides:
        isOrderable in class ClassType
        Returns:
        true if an order is defined for this; false otherwise.
      • getValue

        public Number getValue​(Number value)
        Converts the specified value into a value of this numeric type. E.g. an Integer is converted into a BigDecimal, if this represents the type BigDecimal.
        Specified by:
        getValue in interface NumberType
        Parameters:
        value - value to be converted
        Returns:
        converted value
      • negate

        public Number negate​(Number value)
        Returns -value.
        Specified by:
        negate in interface NumberType
        Parameters:
        value - value to be negated
        Returns:
        -value