Class ELArithmetic
java.lang.Object
org.apache.el.lang.ELArithmetic
- Direct Known Subclasses:
ELArithmetic.BigDecimalDelegate, ELArithmetic.BigIntegerDelegate, ELArithmetic.DoubleDelegate, ELArithmetic.LongDelegate
A helper class of Arithmetic defined by the EL Specification.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classArithmetic delegate for BigDecimal operations.static final classArithmetic delegate for BigInteger operations.static final classArithmetic delegate for double/float operations.static final classArithmetic delegate for long/integer operations. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ELArithmetic.BigDecimalDelegateBigDecimal arithmetic delegate instance.static final ELArithmetic.BigIntegerDelegateBigInteger arithmetic delegate instance.static final ELArithmetic.DoubleDelegateDouble arithmetic delegate instance.static final ELArithmetic.LongDelegateLong arithmetic delegate instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract NumberAdd two numbers.static NumberAdd two objects, coercing them to the appropriate numeric type.protected abstract NumberCoerce a number to the delegate's preferred type.protected final NumberCoerce an object to a number.protected abstract NumberCoerce a string to a number.protected abstract NumberDivide two numbers.static NumberDivide two objects, coercing them to the appropriate numeric type.static booleanCheck if the given object is a number.static booleanisNumberType(Class<?> type) Check if the given class is a number type.protected abstract booleanCheck if this delegate matches the given operand types.protected abstract NumberCompute the modulo of two numbers.static NumberCompute the modulo of two objects, coercing them to the appropriate numeric type.protected abstract NumberMultiply two numbers.static NumberMultiply two objects, coercing them to the appropriate numeric type.protected abstract NumberSubtract two numbers.static NumberSubtract two objects, coercing them to the appropriate numeric type.
-
Field Details
-
BIGDECIMAL
BigDecimal arithmetic delegate instance. -
BIGINTEGER
BigInteger arithmetic delegate instance. -
DOUBLE
Double arithmetic delegate instance. -
LONG
Long arithmetic delegate instance.
-
-
Constructor Details
-
ELArithmetic
protected ELArithmetic()Protected constructor for subclasses.
-
-
Method Details
-
add
-
mod
-
subtract
-
divide
-
multiply
-
isNumber
Check if the given object is a number.- Parameters:
obj- The object to check- Returns:
- true if the object is a number
-
isNumberType
Check if the given class is a number type.- Parameters:
type- The class to check- Returns:
- true if the class is a number type
-
add
-
multiply
-
subtract
-
mod
-
coerce
-
coerce
-
coerce
-
divide
-
matches
-