Package org.kuali.coeus.sys.api.model
Class ScaleTwoDecimal
java.lang.Object
java.lang.Number
org.kuali.coeus.sys.api.model.AbstractDecimal<ScaleTwoDecimal>
org.kuali.coeus.sys.api.model.ScaleTwoDecimal
- All Implemented Interfaces:
Serializable,Comparable<ScaleTwoDecimal>
This class is a wrapper around
BigDecimal. It exposes the only the
needed functionality of BigDecimal, uses a standard
RoundingMode of RoundingMode.HALF_UP
and uses a standard SCALE of 2.
This class is, like BigDecimal, immutable; even methods which
might be expected to change the value actually just return a new instance
with the new value.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ScaleTwoDecimalstatic final intstatic final ScaleTwoDecimalFields inherited from class org.kuali.coeus.sys.api.model.AbstractDecimal
ROUND_BEHAVIOR, value -
Constructor Summary
ConstructorsConstructorDescriptionScaleTwoDecimal(double value) ScaleTwoDecimal(int value) ScaleTwoDecimal(String value) ScaleTwoDecimal(BigDecimal value) -
Method Summary
Modifier and TypeMethodDescriptionprotected ScaleTwoDecimalnewInstance(int value) protected ScaleTwoDecimalnewInstance(BigDecimal value, int scale) protected ScaleTwoDecimalstatic ScaleTwoDecimalreturnZeroIfNull(ScaleTwoDecimal value) returnZEROif the object is nullprotected ScaleTwoDecimalzero()Methods inherited from class org.kuali.coeus.sys.api.model.AbstractDecimal
abs, add, bigDecimalValue, compareTo, divide, doubleValue, equals, floatValue, hashCode, intValue, isGreaterEqual, isGreaterThan, isLessEqual, isLessThan, isNegative, isNonZero, isNumeric, isPositive, isZero, longValue, mod, multiply, negated, percentage, subtract, toStringMethods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
SCALE
public static final int SCALE- See Also:
-
ZERO
-
ONE_HUNDRED
-
-
Constructor Details
-
ScaleTwoDecimal
-
ScaleTwoDecimal
public ScaleTwoDecimal(int value) -
ScaleTwoDecimal
public ScaleTwoDecimal(double value) -
ScaleTwoDecimal
-
-
Method Details
-
newInstance
- Specified by:
newInstancein classAbstractDecimal<ScaleTwoDecimal>
-
newInstance
- Specified by:
newInstancein classAbstractDecimal<ScaleTwoDecimal>
-
zero
- Specified by:
zeroin classAbstractDecimal<ScaleTwoDecimal>
-
oneHundred
- Specified by:
oneHundredin classAbstractDecimal<ScaleTwoDecimal>
-
returnZeroIfNull
returnZEROif the object is null- Parameters:
value- the passed in value orZERO
-