org.apache.commons.functor.core.composite
Class Composite

java.lang.Object
  extended by org.apache.commons.functor.core.composite.Composite

public final class Composite
extends Object

Utility/fluent methods for creating composite functors.

Version:
$Revision: 1166365 $ $Date: 2011-09-07 22:06:50 +0200 (Wed, 07 Sep 2011) $
Author:
Rodney Waldhoff

Constructor Summary
Composite()
          Composite instances should NOT be constructed in standard programming.
 
Method Summary
static
<L,R,G,H,T>
BinaryCompositeBinaryFunction<L,R,T>
function(BinaryFunction<? super G,? super H,? extends T> f, BinaryFunction<? super L,? super R,? extends G> g, BinaryFunction<? super L,? super R,? extends H> h)
          Create a composite BinaryFunction.
static
<L,R,G,H,T>
UnaryCompositeBinaryFunction<L,R,T>
function(BinaryFunction<? super G,? super H,? extends T> f, UnaryFunction<? super L,? extends G> g, UnaryFunction<? super R,? extends H> h)
          Create a composite BinaryFunction.
static
<A,T> CompositeUnaryFunction<A,T>
function(UnaryFunction<? super A,? extends T> f)
          Create a composite UnaryFunction.
static
<A,X,T> CompositeUnaryFunction<A,T>
function(UnaryFunction<? super X,? extends T> f, UnaryFunction<? super A,? extends X> g)
          Create a composite UnaryFunction.
static
<L,R,G,H> UnaryCompositeBinaryPredicate<L,R>
predicate(BinaryPredicate<? super G,? super H> p, UnaryFunction<? super L,? extends G> g, UnaryFunction<? super R,? extends H> h)
          Create a composite BinaryPredicate.
static
<A> CompositeUnaryPredicate<A>
predicate(UnaryPredicate<? super A> pred)
          Create a composite UnaryPredicate.
static
<A,T> CompositeUnaryPredicate<A>
predicate(UnaryPredicate<? super T> predicate, UnaryFunction<? super A,? extends T> function)
          Create a composite UnaryPredicate.
static
<A> CompositeUnaryProcedure<A>
procedure(UnaryProcedure<? super A> procedure)
          Create a composite UnaryProcedure.
static
<A,T> CompositeUnaryProcedure<A>
procedure(UnaryProcedure<? super T> procedure, UnaryFunction<? super A,? extends T> function)
          Create a composite UnaryProcedure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Composite

public Composite()

Composite instances 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 Detail

procedure

public static <A> CompositeUnaryProcedure<A> procedure(UnaryProcedure<? super A> procedure)
Create a composite UnaryProcedure.

Parameters:
procedure - UnaryProcedure to execute against output of f
Returns:
CompositeUnaryProcedure

procedure

public static <A,T> CompositeUnaryProcedure<A> procedure(UnaryProcedure<? super T> procedure,
                                                         UnaryFunction<? super A,? extends T> function)
Create a composite UnaryProcedure.

Parameters:
procedure - UnaryProcedure to execute against output of f
function - UnaryFunction to apply
Returns:
CompositeUnaryProcedure

predicate

public static <A> CompositeUnaryPredicate<A> predicate(UnaryPredicate<? super A> pred)
Create a composite UnaryPredicate.

Parameters:
pred - UnaryPredicate to test the output of f
Returns:
CompositeUnaryPredicate

predicate

public static <A,T> CompositeUnaryPredicate<A> predicate(UnaryPredicate<? super T> predicate,
                                                         UnaryFunction<? super A,? extends T> function)
Create a composite UnaryPredicate.

Parameters:
predicate - UnaryPredicate to test the output of f
function - UnaryFunction to apply
Returns:
CompositeUnaryPredicate

predicate

public static <L,R,G,H> UnaryCompositeBinaryPredicate<L,R> predicate(BinaryPredicate<? super G,? super H> p,
                                                                     UnaryFunction<? super L,? extends G> g,
                                                                     UnaryFunction<? super R,? extends H> h)
Create a composite BinaryPredicate.

Parameters:
p - BinaryPredicate to test output(f), output(g)
g - left UnaryFunction
h - right UnaryFunction
Returns:
BinaryPredicate

function

public static <A,T> CompositeUnaryFunction<A,T> function(UnaryFunction<? super A,? extends T> f)
Create a composite UnaryFunction.

Parameters:
f - UnaryFunction to apply to the output of g
Returns:
UnaryFunction

function

public static <A,X,T> CompositeUnaryFunction<A,T> function(UnaryFunction<? super X,? extends T> f,
                                                           UnaryFunction<? super A,? extends X> g)
Create a composite UnaryFunction.

Parameters:
f - UnaryFunction to apply to the output of g
g - UnaryFunction to apply first
Returns:
UnaryFunction

function

public static <L,R,G,H,T> UnaryCompositeBinaryFunction<L,R,T> function(BinaryFunction<? super G,? super H,? extends T> f,
                                                                       UnaryFunction<? super L,? extends G> g,
                                                                       UnaryFunction<? super R,? extends H> h)
Create a composite BinaryFunction.

Parameters:
f - BinaryFunction to apply to output(f), output(g)
g - left UnaryFunction
h - right UnaryFunction
Returns:
BinaryFunction

function

public static <L,R,G,H,T> BinaryCompositeBinaryFunction<L,R,T> function(BinaryFunction<? super G,? super H,? extends T> f,
                                                                        BinaryFunction<? super L,? super R,? extends G> g,
                                                                        BinaryFunction<? super L,? super R,? extends H> h)
Create a composite BinaryFunction.

Parameters:
f - BinaryFunction to apply to output(f), output(g)
g - left BinaryFunction
h - right BinaryFunction
Returns:
BinaryFunction


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.