Methods Summary |
---|
public synchronized void | add(org.apache.tools.ant.types.resources.comparators.ResourceComparator c)Add a ResourceComparator to this Compare selector.
If multiple ResourceComparators are added, they will be processed in LIFO order.
if (isReference()) {
throw noChildrenAllowed();
}
comp.add(c);
|
public synchronized org.apache.tools.ant.types.ResourceCollection | createControl()Create the nested control element. These are the
resources to compare against.
if (isReference()) {
throw noChildrenAllowed();
}
if (control != null) {
throw oneControl();
}
control = new Union();
return control;
|
protected synchronized void | dieOnCircularReference(java.util.Stack stk, org.apache.tools.ant.Project p)Overrides the version from DataType
to recurse on nested ResourceComparators.
if (isChecked()) {
return;
}
if (isReference()) {
super.dieOnCircularReference(stk, p);
} else {
if (control != null) {
DataType.invokeCircularReferenceCheck(control, stk, p);
}
DataType.invokeCircularReferenceCheck(comp, stk, p);
setChecked(true);
}
|
public synchronized boolean | isSelected(org.apache.tools.ant.types.Resource r){@inheritDoc}
if (isReference()) {
return ((ResourceSelector) getCheckedRef()).isSelected(r);
}
if (control == null) {
throw oneControl();
}
int t = 0, f = 0;
for (Iterator it = control.iterator(); it.hasNext();) {
if (when.evaluate(comp.compare(r, (Resource) it.next()))) {
t++;
} else {
f++;
}
}
return against.evaluate(t, f);
|
private org.apache.tools.ant.BuildException | oneControl()
return new BuildException(super.toString() + ONE_CONTROL_MESSAGE);
|
public synchronized void | setAgainst(org.apache.tools.ant.types.Quantifier against)Set the quantifier to be used. Default "all".
if (isReference()) {
throw tooManyAttributes();
}
this.against = against;
|
public synchronized void | setWhen(org.apache.tools.ant.types.Comparison when)Set the comparison to be used. Default "equal".
if (isReference()) {
throw tooManyAttributes();
}
this.when = when;
|