FileDocCategorySizeDatePackage
AndSelector.javaAPI DocApache Ant 1.702385Wed Dec 13 06:16:24 GMT 2006org.apache.tools.ant.types.selectors

AndSelector

public class AndSelector extends BaseSelectorContainer
This selector has a collection of other selectors, all of which have to select a file in order for this selector to select it.
since
1.5

Fields Summary
Constructors Summary
public AndSelector()
Default constructor.

    
Methods Summary
public booleanisSelected(java.io.File basedir, java.lang.String filename, java.io.File file)
Returns true (the file is selected) only if all other selectors agree that the file should be selected.

param
basedir the base directory the scan is being done from
param
filename the name of the file to check
param
file a java.io.File object for the filename that the selector can use
return
whether the file should be selected or not

        validate();
        Enumeration e = selectorElements();
        boolean result;

        while (e.hasMoreElements()) {
            result = ((FileSelector) e.nextElement()).isSelected(basedir,
                    filename, file);
            if (!result) {
                return false;
            }
        }
        return true;
    
public java.lang.StringtoString()

return
a string representation of the selector

        StringBuffer buf = new StringBuffer();
        if (hasSelectors()) {
            buf.append("{andselect: ");
            buf.append(super.toString());
            buf.append("}");
        }
        return buf.toString();