Class Composite

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

public final class Composite extends Object
Utility/fluent methods for creating composite functors.
Version:
$Revision$ $Date$
  • Constructor Details

    • 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 Details

    • procedure

      public static <A> CompositeUnaryProcedure<A> procedure(UnaryProcedure<? super A> procedure)
      Create a composite UnaryProcedure.
      Type Parameters:
      A - the procedure argument type.
      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.
      Type Parameters:
      A - the function argument type.
      T - the the procedure argument type and function returned value type.
      Parameters:
      procedure - UnaryProcedure to execute against output of f
      function - UnaryFunction to apply
      Returns:
      CompositeUnaryProcedure
    • predicate

      Create a composite UnaryPredicate.
      Type Parameters:
      A - the predicate argument type.
      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.
      Type Parameters:
      A - the function argument type.
      T - the predicate argument type and the function returned value type.
      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.
      Type Parameters:
      L - the output predicate left argument type.
      R - the output predicate right argument type.
      G - the input functions left argument type.
      H - the input functions right argument type.
      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.
      Type Parameters:
      A - the function argument type.
      T - the function returned value type.
      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.
      Type Parameters:
      A - the function argument type.
      X - the function argument type.
      T - the function returned value type.
      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.
      Type Parameters:
      L - the output predicate left argument type.
      R - the output predicate right argument type.
      G - the input functions left argument type.
      H - the input functions right argument type. * @param the function returned value type.
      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.
      Type Parameters:
      L - the output predicate left argument type.
      R - the output predicate right argument type.
      G - the input functions left argument type.
      H - the input functions right argument type. * @param the function returned value type.
      Parameters:
      f - BinaryFunction to apply to output(f), output(g)
      g - left BinaryFunction
      h - right BinaryFunction
      Returns:
      BinaryFunction