|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<MathOperator>
com.antelmann.math.MathOperator
public enum MathOperator
basic math operators that allow to combine two numbers to produce a result
| Enum Constant Summary | |
|---|---|
ADD
|
|
DIVIDE
|
|
MULTIPLY
|
|
RAISE_TO_POWER
|
|
SUBTRACT
|
|
| Method Summary | |
|---|---|
BigDecimal |
asBigDecimal(Number n1,
Number n2)
calls asBigDecimal(Number, Number, int) with BigDecimal.ROUND_HALF_UP |
BigDecimal |
asBigDecimal(Number n1,
Number n2,
int roundingMode)
|
double |
asDouble(double n1,
double n2)
|
double |
asDouble(Number n1,
Number n2)
|
float |
asFloat(float n1,
float n2)
|
float |
asFloat(Number n1,
Number n2)
|
int |
asInt(int n1,
int n2)
|
int |
asInt(Number n1,
Number n2)
|
long |
asLong(long n1,
long n2)
|
long |
asLong(Number n1,
Number n2)
|
Number |
asNumber(Number n1,
Number n2)
|
MathOperator |
fromString(String exp)
|
String |
toString()
|
static MathOperator |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static MathOperator[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final MathOperator ADD
public static final MathOperator SUBTRACT
public static final MathOperator MULTIPLY
public static final MathOperator DIVIDE
public static final MathOperator RAISE_TO_POWER
| Method Detail |
|---|
public static MathOperator[] values()
for (MathOperator c : MathOperator.values()) System.out.println(c);
public static MathOperator valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is nullpublic MathOperator fromString(String exp)
public String toString()
toString in class Enum<MathOperator>
public Number asNumber(Number n1,
Number n2)
public double asDouble(Number n1,
Number n2)
public double asDouble(double n1,
double n2)
public float asFloat(Number n1,
Number n2)
public float asFloat(float n1,
float n2)
public int asInt(Number n1,
Number n2)
public int asInt(int n1,
int n2)
public long asLong(Number n1,
Number n2)
public long asLong(long n1,
long n2)
public BigDecimal asBigDecimal(Number n1,
Number n2)
asBigDecimal(Number, Number, int) with BigDecimal.ROUND_HALF_UP
public BigDecimal asBigDecimal(Number n1,
Number n2,
int roundingMode)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||