Class Compare
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.types.DataType
- 
- org.apache.tools.ant.types.resources.selectors.Compare
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- ResourceSelector
 
 public class Compare extends DataType implements ResourceSelector ResourceSelector that compares against "control" Resource(s) using ResourceComparators.- Since:
- Ant 1.7
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description Compare()
 - 
Method SummaryModifier and Type Method Description voidadd(ResourceComparator c)Add a ResourceComparator to this Compare selector.ResourceCollectioncreateControl()Create the nested control element.protected voiddieOnCircularReference(java.util.Stack<java.lang.Object> stk, Project p)Overrides the version from DataType to recurse on nested ResourceComparators.booleanisSelected(Resource r)Return true if this Resource is selected.voidsetAgainst(Quantifier against)Set the quantifier to be used.voidsetWhen(Comparison when)Set the comparison to be used.- 
Methods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, setRefid, tooManyAttributes, toString
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 
- 
 
- 
- 
- 
Method Detail- 
addpublic void add(ResourceComparator c) Add a ResourceComparator to this Compare selector. If multiple ResourceComparators are added, they will be processed in LIFO order.- Parameters:
- c- the ResourceComparator to add.
 
 - 
setAgainstpublic void setAgainst(Quantifier against) Set the quantifier to be used. Default "all".- Parameters:
- against- the Quantifier EnumeratedAttribute to use.
 
 - 
setWhenpublic void setWhen(Comparison when) Set the comparison to be used. Default "equal".- Parameters:
- when- the Comparison EnumeratedAttribute to use.
 
 - 
createControlpublic ResourceCollection createControl() Create the nested control element. These are the resources to compare against.- Returns:
- ResourceCollection.
 
 - 
isSelectedpublic boolean isSelected(Resource r) Return true if this Resource is selected.- Specified by:
- isSelectedin interface- ResourceSelector
- Parameters:
- r- the Resource to check.
- Returns:
- whether the Resource was selected.
 
 - 
dieOnCircularReferenceprotected void dieOnCircularReference(java.util.Stack<java.lang.Object> stk, Project p) throws BuildExceptionOverrides the version from DataType to recurse on nested ResourceComparators.- Overrides:
- dieOnCircularReferencein class- DataType
- Parameters:
- stk- the stack of data types to use (recursively).
- p- the project to use to dereference the references.
- Throws:
- BuildException- on error.
 
 
- 
 
-