FileDocCategorySizeDatePackage
DependSelector.javaAPI DocApache Ant 1.702455Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.types.selectors

DependSelector

public class DependSelector extends MappingSelector
Selector that filters files based on whether they are newer than a matching file in another directory tree. It can contain a mapper element, so isn't available as an ExtendSelector (since those parameters can't hold other elements).
since
1.5

Fields Summary
Constructors Summary
public DependSelector()
Creates a new DependSelector instance.


    
Methods Summary
public booleanselectionTest(java.io.File srcfile, java.io.File destfile)
this test is our selection test that compared the file with the destfile

param
srcfile the source file
param
destfile the destination file
return
true if destination is out of date

        boolean selected = SelectorUtils.isOutOfDate(srcfile, destfile,
                granularity);
        return selected;
    
public java.lang.StringtoString()

return
a string describing this object

        StringBuffer buf = new StringBuffer("{dependselector targetdir: ");
        if (targetdir == null) {
            buf.append("NOT YET SET");
        } else {
            buf.append(targetdir.getName());
        }
        buf.append(" granularity: ");
        buf.append(granularity);
        if (map != null) {
            buf.append(" mapper: ");
            buf.append(map.toString());
        } else if (mapperElement != null) {
            buf.append(" mapper: ");
            buf.append(mapperElement.toString());
        }
        buf.append("}");
        return buf.toString();