Methods Summary |
---|
public synchronized void | add(ResourceComparator c)Add a delegate ResourceComparator.
if (isReference()) {
throw noChildrenAllowed();
}
if (c == null) {
return;
}
v = (v == null) ? new Vector() : v;
v.add(c);
|
protected void | dieOnCircularReference(java.util.Stack stk, org.apache.tools.ant.Project p)Overrides the version from DataType to recurse on nested ResourceSelector
s.
if (isChecked()) {
return;
}
if (isReference()) {
super.dieOnCircularReference(stk, p);
} else {
if (!(v == null || v.isEmpty())) {
for (Iterator i = v.iterator(); i.hasNext();) {
Object o = i.next();
if (o instanceof DataType) {
stk.push(o);
invokeCircularReferenceCheck((DataType) o, stk, p);
}
}
}
setChecked(true);
}
|
public synchronized boolean | equals(java.lang.Object o)Equality method based on the vector of resources,
or if a reference, the referredto object.
if (o == this) {
return true;
}
if (isReference()) {
return getCheckedRef().equals(o);
}
if (!(o instanceof DelegatedResourceComparator)) {
return false;
}
Vector ov = ((DelegatedResourceComparator) o).v;
return v == null ? ov == null : v.equals(ov);
|
public synchronized int | hashCode()Hashcode based on the rules for equality.
if (isReference()) {
return getCheckedRef().hashCode();
}
return v == null ? 0 : v.hashCode();
|
protected synchronized int | resourceCompare(org.apache.tools.ant.types.Resource foo, org.apache.tools.ant.types.Resource bar){@inheritDoc}
//if no nested, natural order:
if (v == null || v.isEmpty()) {
return foo.compareTo(bar);
}
int result = 0;
for (Iterator i = v.iterator(); result == 0 && i.hasNext();) {
result = ((ResourceComparator) i.next()).resourceCompare(foo, bar);
}
return result;
|