FileDocCategorySizeDatePackage
Type.javaAPI DocApache Ant 1.701599Wed Dec 13 06:16:24 GMT 2006org.apache.tools.ant.types.resources.comparators

Type

public class Type extends ResourceComparator
Compares Resources by is-directory status. As a container of files, a directory is deemed "greater" than a file.
since
Ant 1.7

Fields Summary
Constructors Summary
Methods Summary
protected intresourceCompare(org.apache.tools.ant.types.Resource foo, org.apache.tools.ant.types.Resource bar)
Compare two Resources.

param
foo the first Resource.
param
bar the second Resource.
return
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

        boolean f = foo.isDirectory();
        if (f == bar.isDirectory()) {
            return 0;
        }
        return f ? 1 : -1;