public abstract class IntOperator
extends java.lang.Object
Basic operators for type int
.
Constructor and Description |
---|
IntOperator() |
Modifier and Type | Method and Description |
---|---|
static int |
add(int left,
int right)
Return
left + right . |
static int |
compare(int left,
int right)
Compare
left operand with right operand. |
static int |
divide(int left,
int right)
Return
left / right . |
static boolean |
equal(int left,
int right)
Compare
left operand with right operand. |
static boolean |
greaterEqual(int left,
int right)
Compare
left operand with right operand. |
static boolean |
greaterThan(int left,
int right)
Compare
left operand with right operand. |
static boolean |
lessEqual(int left,
int right)
Compare
left operand with right operand. |
static boolean |
lessThan(int left,
int right)
Compare
left operand with right operand. |
static int |
multiply(int left,
int right)
Return
left * right . |
static int |
negate(int value)
Return
-value . |
static boolean |
notEqual(int left,
int right)
Compare
left operand with right operand. |
static int |
remainder(int left,
int right)
Return
left % right . |
static int |
subtract(int left,
int right)
Return
left - right . |
public static int add(int left, int right)
Return left + right
.
OverflowException
if the result is out of range for type int
.
left
- Left operand.right
- Right operand.public static int compare(int left, int 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 int divide(int left, int right)
Return left / right
.
OverflowException
if the result is out of range for type int
.
left
- Left operand.right
- Right operand.public static boolean equal(int left, int 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(int left, int right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.true
if left >= right
, false
otherwise.public static boolean greaterThan(int left, int right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.true
if left > right
, false
otherwise.public static boolean lessEqual(int left, int right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.true
if left <= right
, false
otherwise.public static boolean lessThan(int left, int right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.true
if left < right
, false
otherwise.public static int multiply(int left, int right)
Return left * right
.
OverflowException
if the result is out of range for type int
.
left
- Left operand.right
- Right operand.public static int negate(int value)
Return -value
.
OverflowException
if the result is out of range for type int
.
value
- Operand value.public static boolean notEqual(int left, int right)
Compare left
operand with right
operand.
left
- Left operand.right
- Right operand.true
if left != right
, false
if left == right
.public static int remainder(int left, int right)
Return left % right
.
OverflowException
if the result is out of range for type int
.
left
- Left operand.right
- Right operand.public static int subtract(int left, int right)
Return left - right
.
OverflowException
if the result is out of range for type int
.
left
- Left operand.right
- Right operand.