Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ix.util
Class Fn

    java.lang.Object
      ix.util.Fn

    public final class Fn

extends java.lang.Object

Function utilities

See Also:
  `Collect`, `Strings`

Field Summary
`static Predicate1` | `alwaysFalse` A predicate that returns false for any object.
`static Predicate1` | `alwaysTrue` A predicate that returns true for any object.
`static Function1` | `identity` The identity function.

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 Function1` | `always(java.lang.Object value)` Returns a function that always returns the same value.
`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` | `isInstanceOf(java.lang.Class c)` Returns a predicate that test whether an object is an instance of the specified class.
`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`

Field Detail

### alwaysTrue

    public static final Predicate1 alwaysTrue

  A predicate that returns true for any object.

### alwaysFalse

    public static final Predicate1 alwaysFalse

  A predicate that returns false for any object.

### identity

    public static final Function1 identity

  The identity function.

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.

### always

    public static Function1 always(java.lang.Object value)

  Returns a function that always returns the same value.

### 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.

### isInstanceOf

    public static Predicate1 isInstanceOf(java.lang.Class c)

  Returns a predicate that test whether an object is an instance of the specified class.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD