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
private static class Operator.AntiCompareMethod extends Operator.CompareMethod
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 Constructor Description AntiCompareMethod(JexlOperator op, JexlMethod m)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectinvoke(java.lang.Object arithmetic, java.lang.Object... params)Invocation method, called when the method invocation should be performed and a value returned.java.lang.ObjecttryInvoke(java.lang.String name, java.lang.Object arithmetic, java.lang.Object... params)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 Detail
-
AntiCompareMethod
AntiCompareMethod(JexlOperator op, JexlMethod m)
-
-
Method Detail
-
invoke
public java.lang.Object invoke(java.lang.Object arithmetic, java.lang.Object... params) throws java.lang.ExceptionDescription 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:
java.lang.Exception- on any error.
-
tryInvoke
public java.lang.Object tryInvoke(java.lang.String name, java.lang.Object arithmetic, java.lang.Object... params) throws JexlException.TryFailedDescription 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)
-
-