Class Functions

java.lang.Object
eu.bandm.tools.util.java.Functions

public abstract class Functions extends Object
Library of constants and combinators for classes implementing Function.
  • Method Details

    • undef

      public static <A, B> Function<A,B> undef(String n)
    • compose

      public static <A, B, C> Function<A,C> compose(Function<? super A,? extends B> inner, Function<? super B,? extends C> outer)
    • curry

      public static <A, B, C> Function<A,Function<B,C>> curry(BiFunction<A,B,C> f)
    • uncurry

      public static <A, B, C> BiFunction<A,B,C> uncurry(Function<A,Function<B,C>> f)
    • constant

      public static <A, B> Function<A,B> constant(B result)
    • binConstant

      public static <A, B, C> BiFunction<A,B,C> binConstant(C result)
    • flip

      public static <A, B, C> BiFunction<B,A,C> flip(BiFunction<A,B,C> f)
    • rightSection

      public static <A, B, C> Function<B,C> rightSection(BiFunction<? super A,? super B,? extends C> f, A a)
    • leftSection

      public static <A, B, C> Function<A,C> leftSection(BiFunction<? super A,? super B,? extends C> f, B arg)
    • compose

      public static <A, B, C, D> BiFunction<A,B,D> compose(BiFunction<? super A,? super B,? extends C> f, Function<? super C,? extends D> g)
    • compose

      public static <A, B, C, D, E> BiFunction<A,C,E> compose(Function<? super A,? extends B> f, Function<? super C,? extends D> g, BiFunction<? super B,? super D,? extends E> h)
    • fail

      public static <A, B> Function<A,B> fail()
    • restrict

      public static <A, B> Function<A,B> restrict(Function<? super A,? extends B> fun, Predicate<? super A> cond)
    • strict

      public static <A, B> Function<A,B> strict(Function<A,B> fun)
    • override

      public static <A, B> Function<A,B> override(Function<? super A,? extends B> first, Function<? super A,? extends B> second)
    • defaultTo

      public static <A, B> Function<A,B> defaultTo(B def, Function<? super A,? extends B> fun)
    • domain

      public static <A, B> Predicate<A> domain(Function<? super A,? extends B> fun)
    • arbitrary

      public static <A> Function<Iterable<? extends A>,A> arbitrary()
    • adjust

      public static <A, B> Function<A,B> adjust(Function<? super A,? extends B> f)
    • trace

      public static <A> Function<A,A> trace(String label)
    • compose

      public static <A, B, C, D> Function<A,D> compose(Function<? super A,? extends B> f1, Function<? super B,? extends C> f2, Function<? super C,? extends D> f3)
    • compose

      public static <A, B, C, D, E> Function<A,E> compose(Function<? super A,? extends B> f1, Function<? super B,? extends C> f2, Function<? super C,? extends D> f3, Function<? super D,? extends E> f4)
    • memoize

      public static <A, B> Function<A,B> memoize(Function<A,B> fun)
    • memoize

      public static <A, B, C> Functions.MemoizedBiFunction<A,B,C> memoize(BiFunction<A,B,C> fun)