commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <>
Subject RE: [FUNCTOR] Does functor have a class for this?
Date Fri, 19 Mar 2004 12:50:21 GMT
Does nobody monitor the functor project?

-----Original Message-----
From: James Carman [] 
Sent: Thursday, March 18, 2004 9:18 AM
Subject: [FUNCTOR] Does functor have a class for this?

I want to turn a BinaryPredicate into a Predicate by using Functions for the
left/right operands to the BinaryPredicate.


public class BinaryPredicateToPredicate implements Predicate


  private final Function leftFunction;

  private final Function rightFunction;

  private final BinaryPredicate binaryPredicate;


  public BinaryPredicateToPredicate( BinaryPredicate binaryPredicate,
Function leftFunction, Function rightPredicate )


    this.leftFunction = leftFunction;

    this.rightFunction = rightFunction;

    this.binaryPredicate = binaryPredicate;



  public boolean test()


    binaryPredicate.test( leftFunction.evaluate(), rightFunction.evaluate()




Does the functor library already have something for this?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message