Class MoneyDatatype
java.lang.Object
org.faktorips.datatype.AbstractDatatype
org.faktorips.datatype.ValueClassNameDatatype
org.faktorips.datatype.classtypes.MoneyDatatype
- All Implemented Interfaces:
Comparable<Datatype>,Datatype,NumericDatatype,ValueDatatype
Datatype for
Money.- 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandivisibleWithoutRemainder(String dividend, String divisor) Decides whether the given dividend can be divided by the divisor without remainder or not.org.faktorips.values.MoneyThis method parses the given string and returns the value as an instance of the class this value datatype represents.booleanbooleanReturnstrueif the datatype has a special instance representingnull, otherwisefalse.Subtraction.booleanMethods inherited from class org.faktorips.datatype.ValueClassNameDatatype
areValuesEqual, compare, getDefaultValue, getName, getQualifiedName, getWrapperType, isAbstract, isImmutable, isMutable, isNull, isParsable, isPrimitive, isValueDatatype, valueToStringMethods inherited from class org.faktorips.datatype.AbstractDatatype
checkReadyToUse, compareTo, equals, hashCode, isEnum, isVoid, matchDatatype, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.faktorips.datatype.Datatype
getName, getQualifiedName, isAbstract, isEnum, isPrimitive, isValueDatatype, isVoidMethods inherited from interface org.faktorips.datatype.ValueDatatype
areValuesEqual, checkReadyToUse, compare, getDefaultValue, getNullObjectId, getWrapperType, isImmutable, isMutable, isNull, isParsable, valueToString
-
Constructor Details
-
MoneyDatatype
public MoneyDatatype()
-
-
Method Details
-
getValue
Description copied from class:ValueClassNameDatatypeThis method parses the given string and returns the value as an instance of the class this value datatype represents. Use with caution: During development time Faktor-IPS maintains all values with their string representation. This allows to change the value's datatype without the need to convert the value from one class to another (e.g. if the string representation is 42 you can change the datatype from integer to string without converting the integer object to a string object.- Specified by:
getValuein interfaceValueDatatype- Specified by:
getValuein classValueClassNameDatatype- Parameters:
s- string representation of the value- Returns:
- The value as instance of the class this datatype represents.
- See Also:
-
hasNullObject
public boolean hasNullObject()Description copied from interface:DatatypeReturnstrueif the datatype has a special instance representingnull, otherwisefalse. The design pattern is called the null-object pattern.- Specified by:
hasNullObjectin interfaceDatatype- Overrides:
hasNullObjectin classValueClassNameDatatype- See Also:
-
supportsCompare
public boolean supportsCompare()- Specified by:
supportsComparein interfaceValueDatatype- Returns:
trueif this datatype is able to compare two values.
-
subtract
Description copied from interface:NumericDatatypeSubtraction. This method is used to validate numeric ranges, see RangeValueSet as an example.- Specified by:
subtractin interfaceNumericDatatype- Parameters:
minuend- The value to be reduced.subtrahend- The value to be used to reduce the minuend- Returns:
- The result of "minuend - subtrahend".
-
divisibleWithoutRemainder
Description copied from interface:NumericDatatypeDecides 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.- Specified by:
divisibleWithoutRemainderin interfaceNumericDatatype- 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.
-
hasDecimalPlaces
public boolean hasDecimalPlaces()- Specified by:
hasDecimalPlacesin interfaceNumericDatatype
-