org.apache.tools.ant.types.resources.comparators

Class DelegatedResourceComparator

Implemented Interfaces:
Cloneable, Comparator

public class DelegatedResourceComparator
extends ResourceComparator

Delegates to other ResourceComparators or, if none specified, uses Resources' natural ordering.
Since:
Ant 1.7

Field Summary

Fields inherited from class org.apache.tools.ant.types.DataType

checked, ref

Fields inherited from class org.apache.tools.ant.ProjectComponent

description, location, project

Method Summary

void
add(ResourceComparator c)
Add a delegate ResourceComparator.
protected void
dieOnCircularReference(Stack stk, Project p)
Overrides the version from DataType to recurse on nested ResourceSelector s.
boolean
equals(Object o)
Equality method based on the vector of resources, or if a reference, the referredto object.
int
hashCode()
Hashcode based on the rules for equality.
protected int
resourceCompare(Resource foo, Resource bar)

Methods inherited from class org.apache.tools.ant.types.resources.comparators.ResourceComparator

compare, equals, hashCode, resourceCompare

Methods inherited from class org.apache.tools.ant.types.DataType

checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, setChecked, setRefid, toString, tooManyAttributes

Methods inherited from class org.apache.tools.ant.ProjectComponent

clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject

Method Details

add

public void add(ResourceComparator c)
Add a delegate ResourceComparator.
Parameters:
c - the next delegate ResourceComparator.

dieOnCircularReference

protected void dieOnCircularReference(Stack stk,
                                      Project p)
            throws BuildException
Overrides the version from DataType to recurse on nested ResourceSelector s.
Overrides:
dieOnCircularReference in interface DataType
Parameters:
stk - the Stack of references.
p - the Project to resolve against.
Throws:
BuildException - on error.

equals

public boolean equals(Object o)
Equality method based on the vector of resources, or if a reference, the referredto object.
Overrides:
equals in interface ResourceComparator
Parameters:
o - the object to check against.
Returns:
true if there is equality.

hashCode

public int hashCode()
Hashcode based on the rules for equality.
Overrides:
hashCode in interface ResourceComparator
Returns:
a hashcode.

resourceCompare

protected int resourceCompare(Resource foo,
                              Resource bar)
Overrides:
resourceCompare in interface ResourceComparator