Package org.apache.tools.ant.taskdefs
Class ResourceCount
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.ResourceCount
Count resources from a ResourceCollection, storing to a property or
 writing to the log.  Can also be used as a Condition.
- Since:
- Ant 1.7
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdd the ResourceCollection to count.booleaneval()Fulfill the condition contract.voidexecute()Execute as a Task.voidsetCount(int c) Set the target count number for use as a Condition.voidSet the name of the property to set in task mode.voidSet the ResourceCollection reference.voidSet the comparison for use as a Condition.Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
- 
Constructor Details- 
ResourceCountpublic ResourceCount()
 
- 
- 
Method Details- 
addAdd the ResourceCollection to count.- Parameters:
- r- the ResourceCollection to count.
- Throws:
- BuildException- if already set.
 
- 
setRefidSet the ResourceCollection reference.- Parameters:
- r- the Reference.
 
- 
executepublic void execute()Execute as a Task.
- 
evalpublic boolean eval()Fulfill the condition contract.- Specified by:
- evalin interface- Condition
- Returns:
- true if the specified ResourceCollection satisfies the set criteria.
- Throws:
- BuildException- if an error occurs.
 
- 
setCountpublic void setCount(int c) Set the target count number for use as a Condition.- Parameters:
- c- number of Resources as int.
 
- 
setWhenSet the comparison for use as a Condition.- Parameters:
- c- Comparison (an EnumeratedAttribute) When.
- See Also:
 
- 
setPropertySet the name of the property to set in task mode.- Parameters:
- p- the property name to set.
 
 
-