ru.yandex.bolts.function
Class Function<A,R>

java.lang.Object
  extended by ru.yandex.bolts.function.Function<A,R>

public abstract class Function<A,R>
extends Object

Function

Author:
Stepan Koltsov
See Also:
F, Transformer

Constructor Summary
Function()
           
 
Method Summary
 Comparator<A> andThen(Comparator<R> comparator)
          Not true function composition
<C> Function<A,C>
andThen(Function<? super R,? extends C> g)
          (f andThen g)(x) = g(f(x))
 Function1B<A> andThen(Function1B<? super R> g)
           
 Function1V<A> andThen(Function1V<? super R> g)
           
 Comparator<A> andThen(Function2I<R,R> comparator)
          (f andThen g)(x) = g(f(x))
 Function1B<A> andThenEquals(R value)
           
 Comparator<A> andThenNaturalComparator()
          And then null low natural comparator
abstract  R apply(A a)
           
 Function0<R> bind(A param)
           
<C> Function<C,R>
compose(Function<C,A> g)
          (f compose g)(x) = f(g(x))
static
<A,B> Function<A,B>
constF(B b)
          Function that always returns the same value
static
<A> Function<A,A>
identityF()
           
 Function<A,R> ignoreNullF()
          Map null to null
 Function1V<A> ignoreResult()
          Ignore result of mapping
static
<T> Function<T,String>
toStringF()
           
<B,S> Function<B,S>
uncheckedCast()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Function

public Function()
Method Detail

apply

public abstract R apply(A a)

andThen

public <C> Function<A,C> andThen(Function<? super R,? extends C> g)
(f andThen g)(x) = g(f(x))

See Also:
Function.andThen(F, F)

andThen

public Function1V<A> andThen(Function1V<? super R> g)

andThen

public Function1B<A> andThen(Function1B<? super R> g)

andThen

public Comparator<A> andThen(Comparator<R> comparator)
Not true function composition


andThen

public Comparator<A> andThen(Function2I<R,R> comparator)
(f andThen g)(x) = g(f(x))


andThenEquals

public Function1B<A> andThenEquals(R value)

andThenNaturalComparator

public Comparator<A> andThenNaturalComparator()
And then null low natural comparator


compose

public <C> Function<C,R> compose(Function<C,A> g)
(f compose g)(x) = f(g(x))

See Also:
Function.compose(F, F)

bind

public Function0<R> bind(A param)

uncheckedCast

public <B,S> Function<B,S> uncheckedCast()

ignoreResult

public Function1V<A> ignoreResult()
Ignore result of mapping


ignoreNullF

public Function<A,R> ignoreNullF()
Map null to null


identityF

public static <A> Function<A,A> identityF()

toStringF

public static <T> Function<T,String> toStringF()

constF

public static <A,B> Function<A,B> constF(B b)
Function that always returns the same value