|
ProgramixGenericLib v4.0.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.programix.math.DecimalTools
public class DecimalTools
| Method Summary | |
|---|---|
static BigDecimal |
convert(int value)
Converts the specified value to a BigDecimal returning one of the shared, common, immutable instances if possible. |
static BigDecimal |
convert(long value)
Converts the specified value to a BigDecimal returning one of the shared, common, immutable instances if possible. |
static BigDecimal |
convert(Number value)
Converts the specified value to a BigDecimal returning one of the shared, common, immutable instances if possible. |
static boolean |
equalTo(BigDecimal a,
BigDecimal b)
Returns true if a is numerically equal to b (with no regard to scale). |
static String |
format(BigDecimal value,
int integerDigitCount,
char integerPaddingChar,
int fractionalDigitCount,
char fractionalPaddingChar,
char thousandGroupingChar)
|
static String |
format(BigDecimal value,
int integerDigitCount,
int fractionalDigitCount)
|
static BigDecimal |
getMaxValueFor(int integerDigitCount,
int fractionalDigitCount)
Returns the largest positive value than can fit into the specified number of integer and fractional digits (all nines). |
static BigDecimal |
getMinValueFor(int integerDigitCount,
int fractionalDigitCount)
Returns the most negative value than can fit into the specified number of integer and fractional digits (all nines preceded by a minus sign). |
static boolean |
greaterThan(BigDecimal a,
BigDecimal b)
Returns true if a is numerically greater than b (with no regard to scale). |
static boolean |
greaterThanOrEqualTo(BigDecimal a,
BigDecimal b)
Returns true if a is numerically greater than or equal to b (with no regard to scale). |
static boolean |
isDifferent(BigDecimal a,
BigDecimal b)
Compares two BigDecimals to see if they are "different" (without regard to the scales of each one). |
static boolean |
isEmpty(BigDecimal val)
Returns true if the specified BigDecimal is either null or zero. |
static boolean |
isNegative(BigDecimal val)
Returns true if val is negative (numerically less than ZERO). |
static boolean |
isNotEmpty(BigDecimal val)
Returns true if the specified BigDecimal is not null and is not equal to zero. |
static boolean |
isNotNegative(BigDecimal val)
Returns true if val is non-negative (numerically greater than or equal to ZERO). |
static boolean |
isNotPositive(BigDecimal val)
Returns true if val is non-positive (numerically less than or equal to ZERO). |
static boolean |
isNotZero(BigDecimal val)
Returns true if val is numerically not equal to ZERO (with no regard to scale). |
static boolean |
isPositive(BigDecimal val)
Returns true if val is positive (numerically greater than ZERO). |
static boolean |
isSame(BigDecimal a,
BigDecimal b)
Compares two BigDecimals to see if they are the "same" (without regard to the scales of each one). |
static boolean |
isZero(BigDecimal val)
Returns true if val is numerically equal to ZERO (with no regard to scale). |
static boolean |
lessThan(BigDecimal a,
BigDecimal b)
Returns true if a is numerically less than b (with no regard to scale). |
static boolean |
lessThanOrEqualTo(BigDecimal a,
BigDecimal b)
Returns true if a is numerically less than or equal to b (with no regard to scale). |
static BigDecimal |
max(BigDecimal a,
BigDecimal b)
Returns the numerically larger of a and b (with no regard to scale). |
static BigDecimal |
max(BigDecimal a,
BigDecimal b,
BigDecimal c)
Returns the numerically largest of a, b and c (with no regard to scale). |
static BigDecimal |
min(BigDecimal a,
BigDecimal b)
Returns the numerically smaller of a and b (with no regard to scale). |
static BigDecimal |
min(BigDecimal a,
BigDecimal b,
BigDecimal c)
Returns the numerically smallest of a, b and c (with no regard to scale). |
static boolean |
notEqualTo(BigDecimal a,
BigDecimal b)
Returns true if a is numerically not equal to b (with no regard to scale). |
static boolean |
notGreaterThan(BigDecimal a,
BigDecimal b)
Returns true if a is numerically not greater than b (with no regard to scale). |
static boolean |
notLessThan(BigDecimal a,
BigDecimal b)
Returns true if a is numerically not less than b (with no regard to scale). |
static BigDecimal |
parseBigDecimal(String source)
Permissively parses the passed String into a BigDecimal. |
static BigDecimal |
parseBigDecimal(String source,
BigDecimal defaultValue)
Permissively parses the passed String into a BigDecimal. |
static double |
parseDouble(String source)
Permissively parses the passed String into a double. |
static double |
parseDouble(String source,
double defaultValue)
Permissively parses the passed String into a double. |
static Value |
parseValue(String source)
Permissively parses the passed String into a Value
that if not empty, wraps an instance of BigDecimal. |
static BigDecimal |
rangeBound(BigDecimal minValue,
BigDecimal value,
BigDecimal maxValue)
Bounds value to the specified range. |
static BigDecimal |
round(BigDecimal value)
Rounds to the nearest 1 (nearest integer). |
static BigDecimal |
round(BigDecimal value,
BigDecimal nearest)
Equivalent to: round(value, nearest, BigDecimal.ROUND_HALF_UP) |
static BigDecimal |
round(BigDecimal value,
BigDecimal nearest,
int roundingMode)
Returns value rounded to the nearest multiple of the specified value nearest. |
static BigDecimal |
roundDollar(BigDecimal value)
Same as round(BigDecimal) (nearest integer). |
static BigDecimal |
roundEighth(BigDecimal value)
Rounds to the nearest 1/8 (multiple of 0.125). |
static BigDecimal |
roundHalf(BigDecimal value)
Rounds to the nearest 1/2 (multiple of 0.5). |
static BigDecimal |
roundHundredth(BigDecimal value)
Rounds to the nearest 0.01. |
static BigDecimal |
roundPenny(BigDecimal value)
Same as roundHundredth(BigDecimal). |
static BigDecimal |
roundQuarter(BigDecimal value)
Rounds to the nearest 1/4 (multiple of 0.25). |
static BigDecimal |
roundSixteenth(BigDecimal value)
Rounds to the nearest 1/16 (multiple of 0.0625). |
static BigDecimal |
roundTenth(BigDecimal value)
Rounds to the nearest 0.1. |
static BigDecimal |
roundThousandth(BigDecimal value)
Rounds to the nearest 0.001. |
static BigDecimal |
sum(BigDecimal[] val)
Returns the sum of all of the values in the array passed in. |
static BigDecimal[] |
toArray(Collection bigDecimals)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final BigDecimal ZERO
public static final BigDecimal ONE
public static final BigDecimal TWO
public static final BigDecimal THREE
public static final BigDecimal FOUR
public static final BigDecimal FIVE
public static final BigDecimal SIX
public static final BigDecimal SEVEN
public static final BigDecimal EIGHT
public static final BigDecimal NINE
public static final BigDecimal TEN
public static final BigDecimal ELEVEN
public static final BigDecimal TWELVE
public static final BigDecimal THIRTEEN
public static final BigDecimal FOURTEEN
public static final BigDecimal FIFTEEN
public static final BigDecimal SIXTEEN
public static final BigDecimal SEVENTEEN
public static final BigDecimal EIGHTEEN
public static final BigDecimal NINETEEN
public static final BigDecimal TWENTY
public static final BigDecimal TWENTY_ONE
public static final BigDecimal TWENTY_TWO
public static final BigDecimal TWENTY_THREE
public static final BigDecimal TWENTY_FOUR
public static final BigDecimal TWENTY_FIVE
public static final BigDecimal TWENTY_SIX
public static final BigDecimal TWENTY_SEVEN
public static final BigDecimal TWENTY_EIGHT
public static final BigDecimal TWENTY_NINE
public static final BigDecimal THIRTY
public static final BigDecimal THIRTY_ONE
public static final BigDecimal THIRTY_TWO
public static final BigDecimal THIRTY_THREE
public static final BigDecimal THIRTY_FOUR
public static final BigDecimal THIRTY_FIVE
public static final BigDecimal THIRTY_SIX
public static final BigDecimal THIRTY_SEVEN
public static final BigDecimal THIRTY_EIGHT
public static final BigDecimal THIRTY_NINE
public static final BigDecimal FORTY
public static final BigDecimal FORTY_ONE
public static final BigDecimal FORTY_TWO
public static final BigDecimal FORTY_THREE
public static final BigDecimal FORTY_FOUR
public static final BigDecimal FORTY_FIVE
public static final BigDecimal FORTY_SIX
public static final BigDecimal FORTY_SEVEN
public static final BigDecimal FORTY_EIGHT
public static final BigDecimal FORTY_NINE
public static final BigDecimal FIFTY
public static final BigDecimal FIFTY_ONE
public static final BigDecimal FIFTY_TWO
public static final BigDecimal FIFTY_THREE
public static final BigDecimal FIFTY_FOUR
public static final BigDecimal FIFTY_FIVE
public static final BigDecimal FIFTY_SIX
public static final BigDecimal FIFTY_SEVEN
public static final BigDecimal FIFTY_EIGHT
public static final BigDecimal FIFTY_NINE
public static final BigDecimal SIXTY
public static final BigDecimal SIXTY_ONE
public static final BigDecimal SIXTY_TWO
public static final BigDecimal SIXTY_THREE
public static final BigDecimal SIXTY_FOUR
public static final BigDecimal SIXTY_FIVE
public static final BigDecimal SIXTY_SIX
public static final BigDecimal SIXTY_SEVEN
public static final BigDecimal SIXTY_EIGHT
public static final BigDecimal SIXTY_NINE
public static final BigDecimal SEVENTY
public static final BigDecimal SEVENTY_ONE
public static final BigDecimal SEVENTY_TWO