Class 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)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object invoke​(java.lang.Object arithmetic, java.lang.Object... params)
      Invocation method, called when the method invocation should be performed and a value returned.
      java.lang.Object tryInvoke​(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 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • invoke

        public java.lang.Object invoke​(java.lang.Object arithmetic,
                                       java.lang.Object... params)
                                throws java.lang.Exception
        Description copied from interface: JexlMethod
        Invocation method, called when the method invocation should be performed and a value returned.
        Specified by:
        invoke in interface JexlMethod
        Overrides:
        invoke in class Operator.CompareMethod
        Parameters:
        arithmetic - the object
        params - 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.TryFailed
        Description copied from interface: JexlMethod
        Attempts 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:
        tryInvoke in interface JexlMethod
        Overrides:
        tryInvoke in class Operator.CompareMethod
        Parameters:
        name - the method name
        arithmetic - the object to invoke the method upon
        params - 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)