Package org.faktorips.datatype
Interface NumericDatatype
- All Superinterfaces:
Comparable<Datatype>,Datatype,ValueDatatype
- All Known Implementing Classes:
BigDecimalDatatype,DecimalDatatype,DoubleDatatype,IntegerDatatype,LongDatatype,MoneyDatatype,PrimitiveIntegerDatatype,PrimitiveLongDatatype
Special value datatype representing numbers.
- Author:
- Jan Ortmann
-
Field Summary
Fields inherited from interface org.faktorips.datatype.Datatype
BIG_DECIMAL, BOOLEAN, DECIMAL, DOUBLE, GREGORIAN_CALENDAR, INTEGER, LONG, MONEY, PRIMITIVE_BOOLEAN, PRIMITIVE_INT, PRIMITIVE_LONG, STRING, VOID -
Method Summary
Modifier and TypeMethodDescriptionbooleandivisibleWithoutRemainder(String dividend, String divisor) Decides whether the given dividend can be divided by the divisor without remainder or not.booleanSubtraction.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.faktorips.datatype.Datatype
getName, getQualifiedName, hasNullObject, isAbstract, isEnum, isPrimitive, isValueDatatype, isVoidMethods inherited from interface org.faktorips.datatype.ValueDatatype
areValuesEqual, checkReadyToUse, compare, getDefaultValue, getNullObjectId, getValue, getWrapperType, isImmutable, isMutable, isNull, isParsable, supportsCompare, valueToString
-
Method Details
-
subtract
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 isnullNumberFormatException- if at least one of minuend and subtrahend can not be converted into a number of this datatype.
-
divisibleWithoutRemainder
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 divideddivisor- The value to be used to divide the dividend- Returns:
trueif dividend can be divided by the divisor without remainder,falseotherwise.- Throws:
NullPointerException- if at least one of dividend and divisor isnullNumberFormatException- if at least one of dividend and divisor can not be converted into a number of this datatype.
-
hasDecimalPlaces
boolean hasDecimalPlaces()
-