Class Conditional
java.lang.Object
org.apache.commons.functor.core.composite.Conditional
Utility methods for creating conditional functors.
- Version:
- $Revision$ $Date$
-
Constructor Summary
ConstructorsConstructorDescriptionConditionalinstances should NOT be constructed in standard programming. -
Method Summary
Modifier and TypeMethodDescriptionstatic <L,R, T> BinaryFunction <L, R, T> function(BinaryPredicate<? super L, ? super R> q, BinaryFunction<? super L, ? super R, ? extends T> r, BinaryFunction<? super L, ? super R, ? extends T> s) Create a conditional BinaryFunction.static <T> Function<T> Create a conditional Function.static <A,T> UnaryFunction <A, T> function(UnaryPredicate<? super A> q, UnaryFunction<? super A, ? extends T> r, UnaryFunction<? super A, ? extends T> s) Create a conditional UnaryFunction.static <L,R> BinaryPredicate <L, R> predicate(BinaryPredicate<? super L, ? super R> q, BinaryPredicate<? super L, ? super R> r, BinaryPredicate<? super L, ? super R> s) Create a conditional BinaryPredicate.static PredicateCreate a conditional Predicate.static <A> UnaryPredicate<A> predicate(UnaryPredicate<? super A> q, UnaryPredicate<? super A> r, UnaryPredicate<? super A> s) Create a conditional UnaryPredicate.static <L,R> BinaryProcedure <L, R> procedure(BinaryPredicate<? super L, ? super R> q, BinaryProcedure<? super L, ? super R> r) Create a guarded BinaryProcedure.static <L,R> BinaryProcedure <L, R> procedure(BinaryPredicate<? super L, ? super R> q, BinaryProcedure<? super L, ? super R> r, BinaryProcedure<? super L, ? super R> s) Create a conditional BinaryProcedure.static ProcedureCreate a guarded Procedure.static ProcedureCreate a conditional Procedure.static <A> UnaryProcedure<A> procedure(UnaryPredicate<? super A> q, UnaryProcedure<? super A> r) Create a guarded UnaryProcedure.static <A> UnaryProcedure<A> procedure(UnaryPredicate<? super A> q, UnaryProcedure<? super A> r, UnaryProcedure<? super A> s) Create a conditional UnaryProcedure.
-
Constructor Details
-
Conditional
public Conditional()Conditionalinstances should NOT be constructed in standard programming. Instead, the methods of the class should be invoked statically.This constructor is public to permit tools that require a JavaBean instance to operate.
-
-
Method Details
-
procedure
-
procedure
-
function
-
predicate
-
procedure
public static <A> UnaryProcedure<A> procedure(UnaryPredicate<? super A> q, UnaryProcedure<? super A> r) Create a guarded UnaryProcedure. -
procedure
public static <A> UnaryProcedure<A> procedure(UnaryPredicate<? super A> q, UnaryProcedure<? super A> r, UnaryProcedure<? super A> s) Create a conditional UnaryProcedure. -
function
public static <A,T> UnaryFunction<A,T> function(UnaryPredicate<? super A> q, UnaryFunction<? super A, ? extends T> r, UnaryFunction<? super A, ? extends T> s) Create a conditional UnaryFunction.- Type Parameters:
A- the predicates argument type.T- the output function returned value type.- Parameters:
q- ifr- thens- else- Returns:
- UnaryFunctioninvalid input: '<'A, T>
-
predicate
public static <A> UnaryPredicate<A> predicate(UnaryPredicate<? super A> q, UnaryPredicate<? super A> r, UnaryPredicate<? super A> s) Create a conditional UnaryPredicate. -
procedure
public static <L,R> BinaryProcedure<L,R> procedure(BinaryPredicate<? super L, ? super R> q, BinaryProcedure<? super L, ? super R> r) Create a guarded BinaryProcedure.- Type Parameters:
L- the left argument type.R- the right argument type.- Parameters:
q- ifr- then- Returns:
- BinaryProcedureinvalid input: '<'L, R>
-
procedure
public static <L,R> BinaryProcedure<L,R> procedure(BinaryPredicate<? super L, ? super R> q, BinaryProcedure<? super L, ? super R> r, BinaryProcedure<? super L, ? super R> s) Create a conditional BinaryProcedure.- Type Parameters:
L- the left argument type.R- the right argument type.- Parameters:
q- ifr- thens- else- Returns:
- BinaryProcedureinvalid input: '<'L, R>
-
function
public static <L,R, BinaryFunction<L,T> R, functionT> (BinaryPredicate<? super L, ? super R> q, BinaryFunction<? super L, ? super R, ? extends T> r, BinaryFunction<? super L, ? super R, ? extends T> s) Create a conditional BinaryFunction.- Type Parameters:
L- the left argument type.R- the right argument type.T- the output function returned value type.- Parameters:
q- ifr- thens- else- Returns:
- BinaryFunctioninvalid input: '<'L, R, T>
-
predicate
public static <L,R> BinaryPredicate<L,R> predicate(BinaryPredicate<? super L, ? super R> q, BinaryPredicate<? super L, ? super R> r, BinaryPredicate<? super L, ? super R> s) Create a conditional BinaryPredicate.- Type Parameters:
L- the left argument type.R- the right argument type.- Parameters:
q- ifr- thens- else- Returns:
- BinaryPredicateinvalid input: '<'L, R>
-