Package org.mvel2.math
Class MathProcessor
- java.lang.Object
-
- org.mvel2.math.MathProcessor
-
public class MathProcessor extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.math.MathContext
MATH_CONTEXT
-
Constructor Summary
Constructors Constructor Description MathProcessor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.Object
_doOperations(int type1, java.lang.Object val1, int operation, int type2, java.lang.Object val2)
private static java.math.BigDecimal
asBigDecimal(java.lang.Object in)
private static int
box(int type)
private static java.lang.Object
doBigDecimalArithmetic(java.math.BigDecimal val1, int operation, java.math.BigDecimal val2, boolean iNumber, int returnTarget)
private static java.lang.Object
doOperationNonNumeric(int type1, java.lang.Object val1, int operation, java.lang.Object val2)
static java.lang.Object
doOperations(int type1, java.lang.Object val1, int operation, int type2, java.lang.Object val2)
static java.lang.Object
doOperations(java.lang.Object val1, int operation, int type2, java.lang.Object val2)
static java.lang.Object
doOperations(java.lang.Object val1, int operation, java.lang.Object val2)
private static java.lang.Object
doOperationsSameType(int type1, java.lang.Object val1, int operation, java.lang.Object val2)
private static java.lang.Object
doPrimWrapperArithmetic(java.lang.Number val1, int operation, java.lang.Number val2, int returnTarget)
private static java.lang.Double
getNumber(java.lang.Object in, int type)
private static boolean
isIntegerType(int type)
private static boolean
isNumericOperation(int type1, java.lang.Object val1, int operation, int type2, java.lang.Object val2)
private static java.lang.Boolean
safeEquals(java.lang.Object val1, java.lang.Object val2)
private static java.lang.Boolean
safeNotEquals(java.lang.Object val1, java.lang.Object val2)
private static double
toDouble(java.lang.Object val)
private static float
toFloat(java.lang.Object val)
private static int
toInteger(java.lang.Object val)
private static long
toLong(java.lang.Object val)
private static short
toShort(java.lang.Object val)
private static java.lang.Object
toType(java.lang.Number val, int returnType)
-
-
-
Method Detail
-
doOperations
public static java.lang.Object doOperations(java.lang.Object val1, int operation, java.lang.Object val2)
-
doOperations
public static java.lang.Object doOperations(java.lang.Object val1, int operation, int type2, java.lang.Object val2)
-
doOperations
public static java.lang.Object doOperations(int type1, java.lang.Object val1, int operation, int type2, java.lang.Object val2)
-
doPrimWrapperArithmetic
private static java.lang.Object doPrimWrapperArithmetic(java.lang.Number val1, int operation, java.lang.Number val2, int returnTarget)
-
toType
private static java.lang.Object toType(java.lang.Number val, int returnType)
-
doBigDecimalArithmetic
private static java.lang.Object doBigDecimalArithmetic(java.math.BigDecimal val1, int operation, java.math.BigDecimal val2, boolean iNumber, int returnTarget)
-
_doOperations
private static java.lang.Object _doOperations(int type1, java.lang.Object val1, int operation, int type2, java.lang.Object val2)
-
isNumericOperation
private static boolean isNumericOperation(int type1, java.lang.Object val1, int operation, int type2, java.lang.Object val2)
-
isIntegerType
private static boolean isIntegerType(int type)
-
doOperationNonNumeric
private static java.lang.Object doOperationNonNumeric(int type1, java.lang.Object val1, int operation, java.lang.Object val2)
-
safeEquals
private static java.lang.Boolean safeEquals(java.lang.Object val1, java.lang.Object val2)
-
safeNotEquals
private static java.lang.Boolean safeNotEquals(java.lang.Object val1, java.lang.Object val2)
-
doOperationsSameType
private static java.lang.Object doOperationsSameType(int type1, java.lang.Object val1, int operation, java.lang.Object val2)
-
toShort
private static short toShort(java.lang.Object val)
-
toInteger
private static int toInteger(java.lang.Object val)
-
toLong
private static long toLong(java.lang.Object val)
-
toDouble
private static double toDouble(java.lang.Object val)
-
toFloat
private static float toFloat(java.lang.Object val)
-
box
private static int box(int type)
-
getNumber
private static java.lang.Double getNumber(java.lang.Object in, int type)
-
asBigDecimal
private static java.math.BigDecimal asBigDecimal(java.lang.Object in)
-
-