com.phoenixst.collections

Class PredicateUtils

public class PredicateUtils extends Object

This class contains static members related to Predicates.

This is mostly equivalent to the class of the same name in Jakarta Commons-Collections 3.0, for those classes covered by this package. No equivalent exists in version 2.1.

Since: 1.0

Version: $Revision: 1.6 $

Author: Ray A. Conner

Method Summary
static PredicateallPredicate(Predicate[] predicates)
Returns a new Predicate which is true if all of its operand predicates are true.
static PredicateallPredicate(Collection predicates)
Returns a new Predicate which is true if all of its operand predicates are true.
static PredicateandPredicate(Predicate left, Predicate right)
Returns a new Predicate which is the logical and of the specified Predicates.
static PredicateanyPredicate(Predicate[] predicates)
Returns a new Predicate which is true if any of its operand predicates are true.
static PredicateanyPredicate(Collection predicates)
Returns a new Predicate which is true if any of its operand predicates are true.
static PredicateequalPredicate(Object testObject)
Returns a new Predicate which is true if the evaluated object is .equals() to the specified object, or if both are null.
static PredicatefalsePredicate()
Returns a Predicate which always returns false.
static PredicateidentityPredicate(Object testObject)
Returns a new Predicate which is true if the evaluated object is the same object (by reference) as the specified object.
static PredicateinstanceofPredicate(Class testClass)
Returns a new Predicate which is true if the evaluated object is of the specified class.
static PredicatenotPredicate(Predicate pred)
Returns a new Predicate which is the logical converse of the specified Predicate.
static PredicateorPredicate(Predicate left, Predicate right)
Returns a new Predicate which is the logical or of the specified Predicates.
static PredicatetruePredicate()
Returns a Predicate which always returns true.

Method Detail

allPredicate

public static Predicate allPredicate(Predicate[] predicates)
Returns a new Predicate which is true if all of its operand predicates are true.

allPredicate

public static Predicate allPredicate(Collection predicates)
Returns a new Predicate which is true if all of its operand predicates are true.

andPredicate

public static Predicate andPredicate(Predicate left, Predicate right)
Returns a new Predicate which is the logical and of the specified Predicates.

anyPredicate

public static Predicate anyPredicate(Predicate[] predicates)
Returns a new Predicate which is true if any of its operand predicates are true.

anyPredicate

public static Predicate anyPredicate(Collection predicates)
Returns a new Predicate which is true if any of its operand predicates are true.

equalPredicate

public static Predicate equalPredicate(Object testObject)
Returns a new Predicate which is true if the evaluated object is .equals() to the specified object, or if both are null.

falsePredicate

public static Predicate falsePredicate()
Returns a Predicate which always returns false.

identityPredicate

public static Predicate identityPredicate(Object testObject)
Returns a new Predicate which is true if the evaluated object is the same object (by reference) as the specified object.

instanceofPredicate

public static Predicate instanceofPredicate(Class testClass)
Returns a new Predicate which is true if the evaluated object is of the specified class.

notPredicate

public static Predicate notPredicate(Predicate pred)
Returns a new Predicate which is the logical converse of the specified Predicate.

orPredicate

public static Predicate orPredicate(Predicate left, Predicate right)
Returns a new Predicate which is the logical or of the specified Predicates.

truePredicate

public static Predicate truePredicate()
Returns a Predicate which always returns true.
See the Plexus project home, hosted by SourceForge.
Copyright B) 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.