org.apache.tools.ant.types.resources

Class Restrict

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

Method Summary
voidadd(ResourceCollection c)
Add the ResourceCollection.
voidadd(ResourceSelector s)
Add a ResourceSelector.
booleanisCache()
Learn whether to cache collections.
booleanisFilesystemOnly()
Fulfill the ResourceCollection contract.
Iteratoriterator()
Fulfill the ResourceCollection contract.
voidsetCache(boolean b)
Set whether to cache collections.
intsize()
Fulfill the ResourceCollection contract.
StringtoString()
Format this Restrict collection as a String.

Method Detail

add

public void add(ResourceCollection c)
Add the ResourceCollection.

Parameters: c the ResourceCollection to add.

add

public void add(ResourceSelector s)
Add a ResourceSelector.

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.

Returns: whether this is a filesystem-only resource collection.

iterator

public final Iterator iterator()
Fulfill the ResourceCollection contract.

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.

Returns: number of elements as int.

toString

public String toString()
Format this Restrict collection as a String.

Returns: the String value of this collection.