FileDocCategorySizeDatePackage
ResourceComparator.javaAPI DocApache Ant 1.702779Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.types.resources.comparators

ResourceComparator

public abstract class ResourceComparator extends org.apache.tools.ant.types.DataType implements Comparator
Abstract Resource Comparator.
since
Ant 1.7

Fields Summary
Constructors Summary
Methods Summary
public final intcompare(java.lang.Object foo, java.lang.Object bar)
Compare two objects.

param
foo the first Object.
param
bar the second Object.
return
a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
throws
ClassCastException if either argument is null.

        dieOnCircularReference();
        ResourceComparator c =
            isReference() ? (ResourceComparator) getCheckedRef() : this;
        return c.resourceCompare((Resource) foo, (Resource) bar);
    
public booleanequals(java.lang.Object o)
Test for equality with this ResourceComparator.

param
o the Object to compare against.
return
true if the specified Object equals this one.

        if (isReference()) {
            return getCheckedRef().equals(o);
        }
        if (o == null) {
            return false;
        }
        return o == this || o.getClass().equals(getClass());
    
public synchronized inthashCode()
Hashcode based on the rules for equality.

return
a hashcode.

        if (isReference()) {
            return getCheckedRef().hashCode();
        }
        return getClass().hashCode();
    
protected abstract 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.