FileDocCategorySizeDatePackage
First.javaAPI DocApache Ant 1.702203Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.types.resources

First

public class First extends BaseResourceCollectionWrapper
ResourceCollection that contains the first count elements of another ResourceCollection.
since
Ant 1.7

Fields Summary
private static final String
BAD_COUNT
private int
count
Constructors Summary
Methods Summary
protected java.util.CollectiongetCollection()
Take the first count elements.

return
a Collection of Resources.

        int ct = getCount();
        if (ct < 0) {
            throw new BuildException(BAD_COUNT);
        }
        Iterator iter = getResourceCollection().iterator();
        ArrayList al = new ArrayList(ct);
        for (int i = 0; i < ct && iter.hasNext(); i++) {
            al.add(iter.next());
        }
        return al;
    
public synchronized intgetCount()
Get the number of resources to be included. Default is 1.

return
the count as int.

        return count;
    
public synchronized voidsetCount(int i)
Set the number of resources to be included.

param
i the count as int.


                       
         
        count = i;