public final class DecimalQuantity_DualStorageBCD extends DecimalQuantity_AbstractBCD
exponent, flags, INFINITY_FLAG, isApproximate, lReqPos, NAN_FLAG, NEGATIVE_FLAG, origDelta, origDouble, precision, rReqPos, scale| Constructor and Description |
|---|
DecimalQuantity_DualStorageBCD() |
DecimalQuantity_DualStorageBCD(BigDecimal input) |
DecimalQuantity_DualStorageBCD(BigInteger input) |
DecimalQuantity_DualStorageBCD(DecimalQuantity_DualStorageBCD other) |
DecimalQuantity_DualStorageBCD(double input) |
DecimalQuantity_DualStorageBCD(int input) |
DecimalQuantity_DualStorageBCD(long input) |
DecimalQuantity_DualStorageBCD(Number number) |
| Modifier and Type | Method and Description |
|---|---|
protected BigDecimal |
bcdToBigDecimal()
Returns a BigDecimal encoding the internal BCD value.
|
protected void |
compact()
Removes trailing zeros from the BCD (adjusting the scale as required) and then computes the
precision.
|
protected void |
copyBcdFrom(DecimalQuantity _other) |
DecimalQuantity |
createCopy()
Like clone, but without the restrictions of the Cloneable interface clone.
|
static DecimalQuantity |
fromExponentString(String num)
Returns a DecimalQuantity after parsing the input string.
|
protected byte |
getDigitPos(int position)
Returns a single digit from the BCD list.
|
int |
maxRepresentableDigits() |
protected void |
popFromLeft(int numDigits)
Directly removes digits from the front of the BCD list.
|
protected void |
readBigIntegerToBcd(BigInteger n)
Sets the internal BCD state to represent the value in the given BigInteger.
|
protected void |
readIntToBcd(int n)
Sets the internal BCD state to represent the value in the given int.
|
protected void |
readLongToBcd(long n)
Sets the internal BCD state to represent the value in the given long.
|
protected void |
setBcdToZero()
Sets the internal representation to zero.
|
protected void |
setDigitPos(int position,
byte value)
Sets the digit in the BCD list.
|
protected void |
shiftLeft(int numDigits)
Adds zeros to the end of the BCD list.
|
protected void |
shiftRight(int numDigits)
Removes digits from the end of the BCD list.
|
String |
toString() |
adjustExponent, adjustMagnitude, applyMaxInteger, clear, copyFrom, equals, fitsInLong, getDigit, getExponent, getLowerDisplayMagnitude, getMagnitude, getPluralOperand, getPositionFingerprint, getStandardPlural, getUpperDisplayMagnitude, isHasIntegerValue, isInfinite, isNaN, isNegative, isZeroish, multiplyBy, negate, populateUFieldPosition, resetExponent, roundToIncrement, roundToInfinity, roundToMagnitude, roundToNickel, setMinFraction, setMinInteger, setToBigDecimal, setToBigInteger, setToDouble, setToInt, setToLong, signum, toBigDecimal, toDouble, toExponentString, toFractionLong, toLong, toPlainString, toPlainString, toScientificString, toScientificString, truncatepublic DecimalQuantity_DualStorageBCD()
public DecimalQuantity_DualStorageBCD(long input)
public DecimalQuantity_DualStorageBCD(int input)
public DecimalQuantity_DualStorageBCD(double input)
public DecimalQuantity_DualStorageBCD(BigInteger input)
public DecimalQuantity_DualStorageBCD(BigDecimal input)
public DecimalQuantity_DualStorageBCD(DecimalQuantity_DualStorageBCD other)
public DecimalQuantity_DualStorageBCD(Number number)
public int maxRepresentableDigits()
public DecimalQuantity createCopy()
DecimalQuantitypublic static DecimalQuantity fromExponentString(String num)
s - The String to parseprotected byte getDigitPos(int position)
DecimalQuantity_AbstractBCDgetDigitPos in class DecimalQuantity_AbstractBCDposition - The position of the digit to pop, counted in BCD units from the least significant
digit. If outside the range supported by the implementation, zero is returned.protected void setDigitPos(int position,
byte value)
DecimalQuantity_AbstractBCDDecimalQuantity_AbstractBCD.compact() after setting the digit, and to ensure
that the precision field is updated to reflect the correct number of digits if a
nonzero digit is added to the decimal.setDigitPos in class DecimalQuantity_AbstractBCDposition - The position of the digit to pop, counted in BCD units from the least significant
digit. If outside the range supported by the implementation, an AssertionError is
thrown.value - The digit to set at the specified location.protected void shiftLeft(int numDigits)
DecimalQuantity_AbstractBCDDecimalQuantity_AbstractBCD.compact().shiftLeft in class DecimalQuantity_AbstractBCDnumDigits - The number of zeros to add.protected void shiftRight(int numDigits)
DecimalQuantity_AbstractBCDDecimalQuantity_AbstractBCD.compact().shiftRight in class DecimalQuantity_AbstractBCDnumDigits - The number of digits to remove.protected void popFromLeft(int numDigits)
DecimalQuantity_AbstractBCDDecimalQuantity_AbstractBCD.compact() after this method.popFromLeft in class DecimalQuantity_AbstractBCDprotected void setBcdToZero()
DecimalQuantity_AbstractBCDsetBcdToZero in class DecimalQuantity_AbstractBCDprotected void readIntToBcd(int n)
DecimalQuantity_AbstractBCDreadIntToBcd in class DecimalQuantity_AbstractBCDprotected void readLongToBcd(long n)
DecimalQuantity_AbstractBCDreadLongToBcd in class DecimalQuantity_AbstractBCDprotected void readBigIntegerToBcd(BigInteger n)
DecimalQuantity_AbstractBCDreadBigIntegerToBcd in class DecimalQuantity_AbstractBCDprotected BigDecimal bcdToBigDecimal()
DecimalQuantity_AbstractBCDbcdToBigDecimal in class DecimalQuantity_AbstractBCDprotected void compact()
DecimalQuantity_AbstractBCD
This method must always be called when bcd changes in order for assumptions to be correct in
methods like DecimalQuantity_AbstractBCD.fractionCount().
compact in class DecimalQuantity_AbstractBCDprotected void copyBcdFrom(DecimalQuantity _other)
copyBcdFrom in class DecimalQuantity_AbstractBCD