public abstract class DecimalOperator
extends java.lang.Object
Basic operators for type decimal
.
Constructor and Description |
---|
DecimalOperator() |
Modifier and Type | Method and Description |
---|---|
static java.math.BigDecimal |
add(java.math.BigDecimal left,
java.math.BigDecimal right)
Return
left + right . |
static int |
compare(java.math.BigDecimal left,
java.math.BigDecimal right)
Compare
left operand with right operand. |
static java.math.BigDecimal |
divide(java.math.BigDecimal left,
java.math.BigDecimal right)
Return
left / right . |
static boolean |
equal(java.math.BigDecimal left,
java.math.BigDecimal right)
Compare
left operand with right operand. |
static boolean |
greaterEqual(java.math.BigDecimal left,
java.math.BigDecimal right)
Compare
left operand with right operand. |
static boolean |
greaterThan(java.math.BigDecimal left,
java.math.BigDecimal right)
Compare
left operand with right operand. |
static boolean |
lessEqual(java.math.BigDecimal left,
java.math.BigDecimal right)
Compare
left operand with right operand. |
static boolean |
lessThan(java.math.BigDecimal left,
java.math.BigDecimal right)
Compare
left operand with right operand. |
static java.math.BigDecimal |
multiply(java.math.BigDecimal left,
java.math.BigDecimal right)
Return
left * right . |
static java.math.BigDecimal |
negate(java.math.BigDecimal value)
Return
-value . |
static boolean |
notEqual(java.math.BigDecimal left,
java.math.BigDecimal right)
Compare
left operand with right operand. |
static java.math.BigDecimal |
remainder(java.math.BigDecimal left,
java.math.BigDecimal right)
Return
left % right . |
static java.math.BigDecimal |
subtract(java.math.BigDecimal left,
java.math.BigDecimal right)
Return
left - right . |
public static java.math.BigDecimal add(java.math.BigDecimal left, java.math.BigDecimal right)
Return left + right
.
left
- Left operand.right
- Right operand.left + right
.public static int compare(java.math.BigDecimal left, java.math.BigDecimal right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.left < right
, zero result if left == right
, positive result if left > right
.public static java.math.BigDecimal divide(java.math.BigDecimal left, java.math.BigDecimal right)
Return left / right
.
left
- Left operand.right
- Right operand.left / right
.public static boolean equal(java.math.BigDecimal left, java.math.BigDecimal right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.true
if left == right
, false
if left != right
.public static boolean greaterEqual(java.math.BigDecimal left, java.math.BigDecimal right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.true
if left >= right
, false
otherwise.public static boolean greaterThan(java.math.BigDecimal left, java.math.BigDecimal right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.true
if left > right
, false
otherwise.public static boolean lessEqual(java.math.BigDecimal left, java.math.BigDecimal right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.true
if left <= right
, false
otherwise.public static boolean lessThan(java.math.BigDecimal left, java.math.BigDecimal right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.true
if left < right
, false
otherwise.public static java.math.BigDecimal multiply(java.math.BigDecimal left, java.math.BigDecimal right)
Return left * right
.
left
- Left operand.right
- Right operand.left * right
.public static java.math.BigDecimal negate(java.math.BigDecimal value)
Return -value
.
value
- Operand value.-value
.public static boolean notEqual(java.math.BigDecimal left, java.math.BigDecimal right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.true
if left != right
, false
if left == right
.public static java.math.BigDecimal remainder(java.math.BigDecimal left, java.math.BigDecimal right)
Return left % right
.
left
- Left operand.right
- Right operand.left % right
.public static java.math.BigDecimal subtract(java.math.BigDecimal left, java.math.BigDecimal right)
Return left - right
.
left
- Left operand.right
- Right operand.left - right
.