ix.util
Class Fn

java.lang.Object
  |
  +--ix.util.Fn

public final class Fn
extends java.lang.Object

Function utilities

See Also:
Collect, Strings

Method Summary
static Function1 accessor(java.lang.Class c, java.lang.String methodName)
          Returns a function that calls the 0-argument method specified by a class and method name.
static java.lang.Object apply(java.lang.Object object, java.lang.reflect.Method meth, java.lang.Object[] arguments)
          Calls the indicated method.
static java.lang.Object apply(java.lang.Object object, java.lang.String methodName, java.util.List arguments)
          Calls the indicated method.
static java.lang.Object apply(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments)
          Calls the indicated method.
static java.lang.Object applyStatic(java.lang.Class c, java.lang.String methodName, java.util.List arguments)
          Calls the indicated static method.
static java.lang.Object applyStatic(java.lang.Class c, java.lang.String methodName, java.lang.Object[] arguments)
          Calls the indicated static method.
static java.lang.reflect.Method getMethod(java.lang.Object object, java.lang.String methodName, java.lang.Class[] sig)
          Returns the specified method if it exists, else null.
static java.lang.reflect.Method getMethod(java.lang.Object object, java.lang.String methodName, java.lang.Object[] arguments)
          Returns the specified method if it exists, else null.
static Predicate1 negate(Predicate1 p)
          Returns a predicate that returns false when the given predicate returns true, and true when it returns false.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

apply

public static java.lang.Object apply(java.lang.Object object,
                                     java.lang.String methodName,
                                     java.util.List arguments)
Calls the indicated method.

apply

public static java.lang.Object apply(java.lang.Object object,
                                     java.lang.String methodName,
                                     java.lang.Object[] arguments)
Calls the indicated method.

apply

public static java.lang.Object apply(java.lang.Object object,
                                     java.lang.reflect.Method meth,
                                     java.lang.Object[] arguments)
Calls the indicated method.

applyStatic

public static java.lang.Object applyStatic(java.lang.Class c,
                                           java.lang.String methodName,
                                           java.util.List arguments)
Calls the indicated static method.

applyStatic

public static java.lang.Object applyStatic(java.lang.Class c,
                                           java.lang.String methodName,
                                           java.lang.Object[] arguments)
Calls the indicated static method.

getMethod

public static java.lang.reflect.Method getMethod(java.lang.Object object,
                                                 java.lang.String methodName,
                                                 java.lang.Object[] arguments)
Returns the specified method if it exists, else null.

getMethod

public static java.lang.reflect.Method getMethod(java.lang.Object object,
                                                 java.lang.String methodName,
                                                 java.lang.Class[] sig)
Returns the specified method if it exists, else null.

accessor

public static Function1 accessor(java.lang.Class c,
                                 java.lang.String methodName)
Returns a function that calls the 0-argument method specified by a class and method name.

negate

public static Predicate1 negate(Predicate1 p)
Returns a predicate that returns false when the given predicate returns true, and true when it returns false.