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

AllPredicate

public final class AllPredicate extends Object implements Predicable

AllPredicate is a composite of Predicables. Upon evaluation, True will only be returned if all of the decorated Predicables evaluate to True.

version
1.0
author
James Yeh

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

param
predicableList A list of Predicables

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

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 all 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 false;
        }
        
        return true;