FileDocCategorySizeDatePackage
AnyPredicate.javaAPI DocAzureus 3.0.3.42249Thu Feb 09 19:43:02 GMT 2006org.gudy.azureus2.core3.predicate

AnyPredicate

public final class AnyPredicate extends Object implements Predicable

AnyPredicate is a composite of a list of Predicables. Upon evaluation, True will only be returned if one or more of the decorated Predicables evaluate to True.

version
1.0

Fields Summary
private List
predicableList
Constructors Summary
public AnyPredicate(List predicableList)
Creates an AnyPredicate

param
predicableList A list of Predicables

        this.predicableList = predicableList;
    
public AnyPredicate(Predicable[] predicables)
Creates an AnyPredicate

param
predicates An array of Predicables

        this(Arrays.asList(predicables));
    
Methods Summary
public booleanevaluate(java.lang.Object obj)
Evaluates an object and returns True if one or more of the pre-supplied conditions are met

param
obj An object
return
True if all conditions are met

        final Iterator iter = predicableList.iterator();
        for(int i = 0; i < predicableList.size(); i++)
        {
            if(((Predicable)iter.next()).evaluate(obj))
                return true;
        }

        return false;