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>
public final class ScaleTwoDecimal extends AbstractDecimal<ScaleTwoDecimal>
This class is a wrapper aroundBigDecimal. It exposes the only the needed functionality ofBigDecimal, uses a standardRoundingModeofRoundingMode.HALF_UPand uses a standard SCALE of 2. This class is, likeBigDecimal, immutable; even methods which might be expected to change the value actually just return a new instance with the new value.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ScaleTwoDecimalONE_HUNDREDstatic intSCALEstatic ScaleTwoDecimalZERO-
Fields inherited from class org.kuali.coeus.sys.api.model.AbstractDecimal
ROUND_BEHAVIOR, value
-
-
Constructor Summary
Constructors Constructor Description ScaleTwoDecimal(double value)ScaleTwoDecimal(int value)ScaleTwoDecimal(String value)ScaleTwoDecimal(BigDecimal value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ScaleTwoDecimalnewInstance(int value)protected ScaleTwoDecimalnewInstance(BigDecimal value, int scale)protected ScaleTwoDecimaloneHundred()static 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, toString
-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Field Detail
-
SCALE
public static final int SCALE
- See Also:
- Constant Field Values
-
ZERO
public static final ScaleTwoDecimal ZERO
-
ONE_HUNDRED
public static final ScaleTwoDecimal ONE_HUNDRED
-
-
Constructor Detail
-
ScaleTwoDecimal
public ScaleTwoDecimal(String value)
-
ScaleTwoDecimal
public ScaleTwoDecimal(int value)
-
ScaleTwoDecimal
public ScaleTwoDecimal(double value)
-
ScaleTwoDecimal
public ScaleTwoDecimal(BigDecimal value)
-
-
Method Detail
-
newInstance
protected ScaleTwoDecimal newInstance(int value)
- Specified by:
newInstancein classAbstractDecimal<ScaleTwoDecimal>
-
newInstance
protected ScaleTwoDecimal newInstance(BigDecimal value, int scale)
- Specified by:
newInstancein classAbstractDecimal<ScaleTwoDecimal>
-
zero
protected ScaleTwoDecimal zero()
- Specified by:
zeroin classAbstractDecimal<ScaleTwoDecimal>
-
oneHundred
protected ScaleTwoDecimal oneHundred()
- Specified by:
oneHundredin classAbstractDecimal<ScaleTwoDecimal>
-
returnZeroIfNull
public static ScaleTwoDecimal returnZeroIfNull(ScaleTwoDecimal value)
returnZEROif the object is null- Parameters:
value- the passed in value orZERO
-
-