org.apache.tools.ant.types.resources
Class FileResourceIterator

java.lang.Object
  extended by org.apache.tools.ant.types.resources.FileResourceIterator
All Implemented Interfaces:
java.util.Iterator

public class FileResourceIterator
extends java.lang.Object
implements java.util.Iterator

Iterator of FileResources from filenames.

Since:
Ant 1.7

Constructor Summary
FileResourceIterator()
          Construct a new FileResourceIterator.
FileResourceIterator(java.io.File f)
          Construct a new FileResourceIterator relative to the specified base directory.
FileResourceIterator(java.io.File f, java.lang.String[] s)
          Construct a new FileResourceIterator over the specified filenames, relative to the specified base directory.
 
Method Summary
 void addFiles(java.lang.String[] s)
          Add an array of filenames to this FileResourceIterator.
 boolean hasNext()
          Find out whether this FileResourceIterator has more elements.
 java.lang.Object next()
          Get the next element from this FileResourceIterator.
 FileResource nextResource()
          Convenience method to return the next resource.
 void remove()
          Not implemented.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileResourceIterator

public FileResourceIterator()
Construct a new FileResourceIterator.


FileResourceIterator

public FileResourceIterator(java.io.File f)
Construct a new FileResourceIterator relative to the specified base directory.

Parameters:
f - the base directory of this instance.

FileResourceIterator

public FileResourceIterator(java.io.File f,
                            java.lang.String[] s)
Construct a new FileResourceIterator over the specified filenames, relative to the specified base directory.

Parameters:
f - the base directory of this instance.
s - the String[] of filenames.
Method Detail

addFiles

public void addFiles(java.lang.String[] s)
Add an array of filenames to this FileResourceIterator.

Parameters:
s - the filenames to add.

hasNext

public boolean hasNext()
Find out whether this FileResourceIterator has more elements.

Specified by:
hasNext in interface java.util.Iterator
Returns:
whether there are more Resources to iterate over.

next

public java.lang.Object next()
Get the next element from this FileResourceIterator.

Specified by:
next in interface java.util.Iterator
Returns:
the next Object.

remove

public void remove()
Not implemented.

Specified by:
remove in interface java.util.Iterator

nextResource

public FileResource nextResource()
Convenience method to return the next resource.

Returns:
the next File.