org.shapelogic.predicate
Class PredicateBinder

java.lang.Object
  extended by org.shapelogic.predicate.PredicateBinder

public class PredicateBinder
extends java.lang.Object

Transform predicates.
E.g. binary predicates to unary predicates.

Author:
Sami Badawi

Constructor Summary
PredicateBinder()
           
 
Method Summary
static
<In0,In1,In2>
Predicate<In2>
bind0(BinaryPredicate<In0,In1> binaryPredicate, Calc1<In2,In1> calc, In0 bindObject)
          Combining a Stream represented as a CalcIndex0 with a binary Predicate.
static
<In0,In1> Predicate<In1>
bind0(BinaryPredicate<In0,In1> binaryPredicate, In0 bindObject)
          Transform binary predicates to unary predicates.
static
<In0,In1> Predicate<In0>
bind1(BinaryPredicate<In0,In1> binaryPredicate, In1 bindObject)
          Transform binary predicates to unary predicates.
static
<In> Predicate<In>
calc1ToPredicate(Calc1<In,java.lang.Boolean> calc)
          Predicate and Calc has different signature this is an adapter method.
static Predicate<java.lang.Integer> calcIndex0ToPredicate(CalcIndex0<java.lang.Boolean> calc)
          Predicate and Calc has different signature this is an adapter method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PredicateBinder

public PredicateBinder()
Method Detail

bind0

public static <In0,In1> Predicate<In1> bind0(BinaryPredicate<In0,In1> binaryPredicate,
                                             In0 bindObject)
Transform binary predicates to unary predicates. Bind the element 0 to the given bindObject


bind1

public static <In0,In1> Predicate<In0> bind1(BinaryPredicate<In0,In1> binaryPredicate,
                                             In1 bindObject)
Transform binary predicates to unary predicates. Bind the element 1 to the given bindObject


calcIndex0ToPredicate

public static Predicate<java.lang.Integer> calcIndex0ToPredicate(CalcIndex0<java.lang.Boolean> calc)
Predicate and Calc has different signature this is an adapter method.
It creates a thin wrapper.

Parameters:
calc -
Returns:

calc1ToPredicate

public static <In> Predicate<In> calc1ToPredicate(Calc1<In,java.lang.Boolean> calc)
Predicate and Calc has different signature this is an adapter method.
It creates a thin wrapper.

Parameters:
calc -
Returns:

bind0

public static <In0,In1,In2> Predicate<In2> bind0(BinaryPredicate<In0,In1> binaryPredicate,
                                                 Calc1<In2,In1> calc,
                                                 In0 bindObject)
Combining a Stream represented as a CalcIndex0 with a binary Predicate.

Type Parameters:
In1 -
Parameters:
binaryPredicate -
calc -
Returns:


Copyright © 2009. All Rights Reserved.