commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject RE: [collections] Element of Predicate?
Date Tue, 07 Feb 2006 16:40:52 GMT

To be more precise:

public class ElementOfPredicate implements Predicate 
{
  private final Collection c;

  public ElementOfPredicate( Collection c )
  {
    this.c = c;
  }

  public boolean evaluate( Object o )
  {
    return c.contains( o );
  }
}

-----Original Message-----
From: James Carman [mailto:james@carmanconsulting.com] 
Sent: Tuesday, February 07, 2006 11:21 AM
To: 'Jakarta Commons Developers List'
Subject: [collections] Element of Predicate?

I couldn't find it, but do we have an ElementOfPredicate somewhere.
Basically, it'd return true if the object is an element of a collection
that's passed into the constructor?



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message