Interface NumericDatatype

All Superinterfaces:
Comparable<Datatype>, Datatype, ValueDatatype
All Known Implementing Classes:
BigDecimalDatatype, DecimalDatatype, DoubleDatatype, IntegerDatatype, LongDatatype, MoneyDatatype, PrimitiveIntegerDatatype, PrimitiveLongDatatype

public interface NumericDatatype extends ValueDatatype
Special value datatype representing numbers.
Author:
Jan Ortmann
  • Method Details

    • subtract

      String subtract(String minuend, String subtrahend)
      Subtraction. This method is used to validate numeric ranges, see RangeValueSet as an example.
      Parameters:
      minuend - The value to be reduced.
      subtrahend - The value to be used to reduce the minuend
      Returns:
      The result of "minuend - subtrahend".
      Throws:
      NullPointerException - if at least one of minuend and subtrahend is null
      NumberFormatException - if at least one of minuend and subtrahend can not be converted into a number of this datatype.
    • divisibleWithoutRemainder

      boolean divisibleWithoutRemainder(String dividend, String divisor)
      Decides whether the given dividend can be divided by the divisor without remainder or not. This method is used to validate numeric ranges, see RangeValueSet as an example.
      Parameters:
      dividend - The value to be divided
      divisor - The value to be used to divide the dividend
      Returns:
      true if dividend can be divided by the divisor without remainder, false otherwise.
      Throws:
      NullPointerException - if at least one of dividend and divisor is null
      NumberFormatException - if at least one of dividend and divisor can not be converted into a number of this datatype.
    • hasDecimalPlaces

      boolean hasDecimalPlaces()