| java.lang.Object net.sf.jga.fn.adaptor.AdaptorFunctors
AdaptorFunctors | final public class AdaptorFunctors (Code) | | Static factory methods for selected functors in the Adaptor package.
Copyright © 2006 David A. Hall
author: David A. Hall |
Method Summary | |
public static Generator<Boolean> | and(Generator<Boolean> g1, Generator<Boolean> g2) Returns a Boolean Generator that produces TRUE when both input generators return TRUE. | public static UnaryFunctor<T, Boolean> | and(UnaryFunctor<T, Boolean> uf1, UnaryFunctor<T, Boolean> uf2) Returns a Boolean Functor that produces TRUE when both input functors return TRUE for
same given argument. | public static BinaryFunctor<T1, T2, Boolean> | and(BinaryFunctor<T1, T2, Boolean> uf1, BinaryFunctor<T1, T2, Boolean> uf2) Returns a Boolean Functor that produces TRUE when both input functors return TRUE for
same given pair of arguments. | public static Generator<R> | conditional(Generator<Boolean> test, Generator<R> trueFn) Returns a generator that evaluates the test and, when true, evaluates the
trueFn and returns the results. | public static Generator<R> | conditional(Generator<Boolean> test, Generator<R> trueFn, Generator<R> falseFn) Returns a generator that evaluates the test and, when true, evaluates the
trueFn and returns the results. | public static UnaryFunctor<T, R> | conditional(UnaryFunctor<T, Boolean> test, UnaryFunctor<T, R> trueFn) Returns a functor that evaluates the test and, when true, evaluates the
trueFn and returns the results. | public static UnaryFunctor<T, R> | conditional(UnaryFunctor<T, Boolean> test, UnaryFunctor<T, R> trueFn, UnaryFunctor<T, R> falseFn) Returns a functor that evaluates the test and, when true, evaluates the
trueFn and returns the results. | public static BinaryFunctor<T1, T2, R> | conditional(BinaryFunctor<T1, T2, Boolean> test, BinaryFunctor<T1, T2, R> trueFn) Returns a functor that evaluates the test and, when true, evaluates the
trueFn and returns the results. | public static BinaryFunctor<T1, T2, R> | conditional(BinaryFunctor<T1, T2, Boolean> test, BinaryFunctor<T1, T2, R> trueFn, BinaryFunctor<T1, T2, R> falseFn) Returns a functor that evaluates the test and, when true, evaluates the
trueFn and returns the results. | public static Generator<R> | constant(R value) | public static BinaryFunctor<T1, T2, R> | constantBinary(R value) | public static UnaryFunctor<T, R> | constantUnary(R value) | public static UnaryFunctor<T, T> | identity() | public static Generator<Boolean> | or(Generator<Boolean> g1, Generator<Boolean> g2) Returns a Boolean Generator that produces TRUE when either input generators return TRUE. | public static UnaryFunctor<T, Boolean> | or(UnaryFunctor<T, Boolean> uf1, UnaryFunctor<T, Boolean> uf2) Returns a Boolean Functor that produces TRUE when either input functors return TRUE for
same given argument. | public static BinaryFunctor<T1, T2, Boolean> | or(BinaryFunctor<T1, T2, Boolean> uf1, BinaryFunctor<T1, T2, Boolean> uf2) Returns a Boolean Functor that produces TRUE when either input functors return TRUE for
same given pair of arguments. | public static BinaryFunctor<T1, T2, T1> | project1st() | public static BinaryFunctor<T1, T2, T2> | project2nd() |
conditional | public static Generator<R> conditional(Generator<Boolean> test, Generator<R> trueFn)(Code) | | Returns a generator that evaluates the test and, when true, evaluates the
trueFn and returns the results. When the test is false, the
generator returns null.
|
conditional | public static Generator<R> conditional(Generator<Boolean> test, Generator<R> trueFn, Generator<R> falseFn)(Code) | | Returns a generator that evaluates the test and, when true, evaluates the
trueFn and returns the results. When the test is false, the
generator evaluates falseFn and the returns the results
|
conditional | public static UnaryFunctor<T, R> conditional(UnaryFunctor<T, Boolean> test, UnaryFunctor<T, R> trueFn)(Code) | | Returns a functor that evaluates the test and, when true, evaluates the
trueFn and returns the results. When the test is false, the
functor returns null. Both functors receiv the same argument when evaluated.
|
conditional | public static UnaryFunctor<T, R> conditional(UnaryFunctor<T, Boolean> test, UnaryFunctor<T, R> trueFn, UnaryFunctor<T, R> falseFn)(Code) | | Returns a functor that evaluates the test and, when true, evaluates the
trueFn and returns the results. When the test is false, the
functor evaluates falseFn and the returns the results. Both functors
that are evaluated receive the same pair of arguments.
|
conditional | public static BinaryFunctor<T1, T2, R> conditional(BinaryFunctor<T1, T2, Boolean> test, BinaryFunctor<T1, T2, R> trueFn)(Code) | | Returns a functor that evaluates the test and, when true, evaluates the
trueFn and returns the results. When the test is false, the
functor returns null. Both functors receive the same pair of arguments when
valuated.
|
conditional | public static BinaryFunctor<T1, T2, R> conditional(BinaryFunctor<T1, T2, Boolean> test, BinaryFunctor<T1, T2, R> trueFn, BinaryFunctor<T1, T2, R> falseFn)(Code) | | Returns a functor that evaluates the test and, when true, evaluates the
trueFn and returns the results. When the test is false, the
functor evaluates falseFn and the returns the results. Both functors
that are evaluated receive the same pair of arguments.
|
|
|