|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectigpp.util.Calc
public class Calc
Perform simple mathematical operations.
Constructor Summary | |
---|---|
Calc()
|
Method Summary | |
---|---|
static long |
ceil(double v)
Round a value up to nearest integer and return value as a long. |
static long |
floor(double v)
Round a value down to nearest integer and return value as a long. |
static double |
perform(double v1,
String operation,
double v2)
Perform an operation on two arguments. |
static double |
perform(double v1,
String operation,
String v2)
Perform an operation on two arguments. |
static double |
perform(int v1,
String operation,
String v2)
Perform an operation on two arguments. |
static double |
perform(long v1,
String operation,
long v2)
Perform an operation on two arguments. |
static double |
perform(long v1,
String operation,
String v2)
Perform an operation on two arguments. |
static double |
perform(String v1,
String operation,
double v2)
Perform an operation on two arguments. |
static double |
perform(String v1,
String operation,
int v2)
Perform an operation on two arguments. |
static double |
perform(String v1,
String operation,
long v2)
Perform an operation on two arguments. |
static double |
perform(String v1,
String operation,
String v2)
Perform an operation on two arguments. |
static double |
sum(ArrayList<String> list)
Sum all the values in a list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Calc()
Method Detail |
---|
public static double perform(double v1, String operation, double v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operand
public static double perform(String v1, String operation, String v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operand
public static double perform(long v1, String operation, String v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operand
public static double perform(int v1, String operation, String v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operand
public static double perform(double v1, String operation, String v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operand
public static double perform(String v1, String operation, double v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operand
public static double perform(String v1, String operation, long v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operand
public static double perform(String v1, String operation, int v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operand
public static double perform(long v1, String operation, long v2)
v1
- the first operandoperation
- the symbol for the operation. Allowed values are: -, +, *, /, %v2
- the second operand
public static long floor(double v)
v
- the value
public static long ceil(double v)
v
- the value
public static double sum(ArrayList<String> list)
list
- an set of value to sum
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |