FileDocCategorySizeDatePackage
Restrict.javaAPI DocApache Ant 1.704538Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.types.resources

Restrict

public class Restrict extends org.apache.tools.ant.types.resources.selectors.ResourceSelectorContainer implements org.apache.tools.ant.types.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

Fields Summary
private BaseResourceCollectionWrapper
w
Constructors Summary
Methods Summary
public synchronized voidadd(org.apache.tools.ant.types.ResourceCollection c)
Add the ResourceCollection.

param
c the ResourceCollection to add.


                  
         
        if (isReference()) {
            throw noChildrenAllowed();
        }
        if (c == null) {
            return;
        }
        w.add(c);
    
public synchronized voidadd(org.apache.tools.ant.types.resources.selectors.ResourceSelector s)
Add a ResourceSelector.

param
s the ResourceSelector to add.

        if (s == null) {
            return;
        }
        super.add(s);
        FailFast.invalidate(this);
    
public synchronized booleanisCache()
Learn whether to cache collections. Default is true.

return
boolean cache flag.

        return w.isCache();
    
public synchronized booleanisFilesystemOnly()
Fulfill the ResourceCollection contract.

return
whether this is a filesystem-only resource collection.

        if (isReference()) {
            return ((Restrict) getCheckedRef()).isFilesystemOnly();
        }
        dieOnCircularReference();
        return w.isFilesystemOnly();
    
public final synchronized java.util.Iteratoriterator()
Fulfill the ResourceCollection contract.

return
an Iterator of Resources.

        if (isReference()) {
            return ((Restrict) getCheckedRef()).iterator();
        }
        dieOnCircularReference();
        return w.iterator();
    
public synchronized voidsetCache(boolean b)
Set whether to cache collections.

param
b boolean cache flag.

        w.setCache(b);
    
public synchronized intsize()
Fulfill the ResourceCollection contract.

return
number of elements as int.

        if (isReference()) {
            return ((Restrict) getCheckedRef()).size();
        }
        dieOnCircularReference();
        return w.size();
    
public synchronized java.lang.StringtoString()
Format this Restrict collection as a String.

return
the String value of this collection.

        if (isReference()) {
            return getCheckedRef().toString();
        }
        dieOnCircularReference();
        return w.toString();