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