public final class ScaleTwoDecimal extends AbstractDecimal<ScaleTwoDecimal>
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.Modifier and Type | Field and Description |
---|---|
static ScaleTwoDecimal |
ONE_HUNDRED |
static int |
SCALE |
static ScaleTwoDecimal |
ZERO |
ROUND_BEHAVIOR, value
Constructor and Description |
---|
ScaleTwoDecimal(BigDecimal value) |
ScaleTwoDecimal(double value) |
ScaleTwoDecimal(int value) |
ScaleTwoDecimal(String value) |
Modifier and Type | Method and Description |
---|---|
protected ScaleTwoDecimal |
newInstance(BigDecimal value,
int scale) |
protected ScaleTwoDecimal |
newInstance(int value) |
protected ScaleTwoDecimal |
oneHundred() |
static ScaleTwoDecimal |
returnZeroIfNull(ScaleTwoDecimal value)
return
ZERO if the object is null |
protected ScaleTwoDecimal |
zero() |
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
byteValue, shortValue
public static final int SCALE
public static final ScaleTwoDecimal ZERO
public static final ScaleTwoDecimal ONE_HUNDRED
public ScaleTwoDecimal(String value)
public ScaleTwoDecimal(int value)
public ScaleTwoDecimal(double value)
public ScaleTwoDecimal(BigDecimal value)
protected ScaleTwoDecimal newInstance(int value)
newInstance
in class AbstractDecimal<ScaleTwoDecimal>
protected ScaleTwoDecimal newInstance(BigDecimal value, int scale)
newInstance
in class AbstractDecimal<ScaleTwoDecimal>
protected ScaleTwoDecimal zero()
zero
in class AbstractDecimal<ScaleTwoDecimal>
protected ScaleTwoDecimal oneHundred()
oneHundred
in class AbstractDecimal<ScaleTwoDecimal>
public static ScaleTwoDecimal returnZeroIfNull(ScaleTwoDecimal value)
ZERO
if the object is nullvalue
- the passed in value or ZERO
Copyright © 2014 The Kuali Foundation. All rights reserved.