Class Operator.AntiCompareMethod
java.lang.Object
org.apache.commons.jexl3.internal.Operator.CompareMethod
org.apache.commons.jexl3.internal.Operator.AntiCompareMethod
- All Implemented Interfaces:
JexlMethod
- Enclosing class:
- Operator
The reverse compare swaps left and right arguments and exploits the symmetry
of compare as in: compare(a, b) <=> -compare(b, a)
-
Field Summary
Fields inherited from class org.apache.commons.jexl3.internal.Operator.CompareMethod
compare, operator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionInvocation method, called when the method invocation should be performed and a value returned.Attempts to reuse this JexlMethod, checking that it is compatible with the actual set of arguments.Methods inherited from class org.apache.commons.jexl3.internal.Operator.CompareMethod
getReturnType, isCacheable, operate, tryFailed
-
Constructor Details
-
AntiCompareMethod
AntiCompareMethod(JexlOperator op, JexlMethod m)
-
-
Method Details
-
invoke
Description copied from interface:JexlMethodInvocation method, called when the method invocation should be performed and a value returned.- Specified by:
invokein interfaceJexlMethod- Overrides:
invokein classOperator.CompareMethod- Parameters:
arithmetic- The objectparams- method parameters.- Returns:
- The result
- Throws:
Exception- on any error.
-
tryInvoke
public Object tryInvoke(String name, Object arithmetic, Object... params) throws JexlException.TryFailed Description copied from interface:JexlMethodAttempts to reuse this JexlMethod, checking that it is compatible with the actual set of arguments. Related to isCacheable since this method is often used with cached JexlMethod instances.- Specified by:
tryInvokein interfaceJexlMethod- Overrides:
tryInvokein classOperator.CompareMethod- Parameters:
name- The method namearithmetic- The object to invoke the method uponparams- The method arguments- Returns:
- The result of the method invocation that should be checked by tryFailed to determine if it succeeded or failed.
- Throws:
JexlException.TryFailed- if the underlying method was invoked but threw an exception (InvocationTargetException)
-