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

EqualComparator

public class EqualComparator extends Object implements Comparator
Simple implementation of Comparator for use in CacheSelector. compare() returns '0' (should not be selected) if both parameter are equal otherwise '1' (should be selected).
version
2003-09-13
since
Ant 1.6

Fields Summary
Constructors Summary
Methods Summary
public intcompare(java.lang.Object o1, java.lang.Object o2)
Implements Comparator.compare().

param
o1 the first object
param
o2 the second object
return
0, if both are equal, otherwise 1

        if (o1 == null) {
            if (o2 == null) {
                return 1;
            }
            return 0;
        }
        return (o1.equals(o2)) ? 0 : 1;
    
public java.lang.StringtoString()
Override Object.toString().

return
information about this comparator

        return "EqualComparator";