org.apache.tools.ant.taskdefs

Class ResourceCount

public class ResourceCount extends Task implements Condition

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

Method Summary
voidadd(ResourceCollection r)
Add 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.
voidsetProperty(String p)
Set the name of the property to set in task mode.
voidsetRefid(Reference r)
Set the ResourceCollection reference.
voidsetWhen(Comparison c)
Set the comparison for use as a Condition.

Method Detail

add

public void add(ResourceCollection r)
Add the ResourceCollection to count.

Parameters: r the ResourceCollection to count.

Throws: BuildException if already set.

eval

public boolean eval()
Fulfill the condition contract.

Returns: true if the specified ResourceCollection satisfies the set criteria.

Throws: BuildException if an error occurs.

execute

public void execute()
Execute as a Task.

setCount

public void setCount(int c)
Set the target count number for use as a Condition.

Parameters: c number of Resources as int.

setProperty

public void setProperty(String p)
Set the name of the property to set in task mode.

Parameters: p the property name to set.

setRefid

public void setRefid(Reference r)
Set the ResourceCollection reference.

Parameters: r the Reference.

setWhen

public void setWhen(Comparison c)
Set the comparison for use as a Condition.

Parameters: c Comparison (an EnumeratedAttribute) When.

See Also: Comparison