FileDocCategorySizeDatePackage
Reverse.javaAPI DocApache Ant 1.702352Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.types.resources.comparators

Reverse

public class Reverse extends ResourceComparator
Reverses another ResourceComparator. If no nested ResourceComparator is supplied, the compared Resources' natural order will be reversed.
since
Ant 1.7

Fields Summary
private static final String
ONE_NESTED
private ResourceComparator
nested
Constructors Summary
public Reverse()
Default constructor.


           
      
    
public Reverse(ResourceComparator c)
Construct a new Reverse, supplying the ResourceComparator to be reversed.

param
c the ResourceComparator to reverse.

        add(c);
    
Methods Summary
public voidadd(ResourceComparator c)
Add the ResourceComparator to reverse.

param
c the ResourceComparator to add.

        if (nested != null) {
            throw new BuildException(ONE_NESTED);
        }
        nested = c;
    
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 greater than, equal to, or less than the second.

        return -1 * (nested == null
            ? foo.compareTo(bar) : nested.compare(foo, bar));