org.apache.tools.ant.types.resources

Class Restrict

Implemented Interfaces:
Cloneable, ResourceCollection

public class Restrict
extends ResourceSelectorContainer
implements ResourceCollection

ResourceCollection that allows a number of selectors to be applied to a single ResourceCollection for the purposes of restricting or narrowing results.
Since:
Ant 1.7

Field Summary

Fields inherited from class org.apache.tools.ant.types.DataType

checked, ref

Fields inherited from class org.apache.tools.ant.ProjectComponent

description, location, project

Method Summary

void
add(ResourceCollection c)
Add the ResourceCollection.
void
add(ResourceSelector s)
Add a ResourceSelector.
boolean
isCache()
Learn whether to cache collections.
boolean
isFilesystemOnly()
Fulfill the ResourceCollection contract.
Iterator
iterator()
Fulfill the ResourceCollection contract.
void
setCache(boolean b)
Set whether to cache collections.
int
size()
Fulfill the ResourceCollection contract.
String
toString()
Format this Restrict collection as a String.

Methods inherited from class org.apache.tools.ant.types.resources.selectors.ResourceSelectorContainer

add, dieOnCircularReference, getSelectors, hasSelectors, selectorCount

Methods inherited from class org.apache.tools.ant.types.DataType

checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, setChecked, setRefid, toString, tooManyAttributes

Methods inherited from class org.apache.tools.ant.ProjectComponent

clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject

Method Details

add

public void add(ResourceCollection c)
Add the ResourceCollection.
Parameters:
c - the ResourceCollection to add.

add

public void add(ResourceSelector s)
Add a ResourceSelector.
Overrides:
add in interface ResourceSelectorContainer
Parameters:
s - the ResourceSelector to add.

isCache

public boolean isCache()
Learn whether to cache collections. Default is true.
Returns:
boolean cache flag.

isFilesystemOnly

public boolean isFilesystemOnly()
Fulfill the ResourceCollection contract.
Specified by:
isFilesystemOnly in interface ResourceCollection
Returns:
whether this is a filesystem-only resource collection.

iterator

public final Iterator iterator()
Fulfill the ResourceCollection contract.
Specified by:
iterator in interface ResourceCollection
Returns:
an Iterator of Resources.

setCache

public void setCache(boolean b)
Set whether to cache collections.
Parameters:
b - boolean cache flag.

size

public int size()
Fulfill the ResourceCollection contract.
Specified by:
size in interface ResourceCollection
Returns:
number of elements as int.

toString

public String toString()
Format this Restrict collection as a String.
Overrides:
toString in interface DataType
Returns:
the String value of this collection.