FileResourceIterator (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.types.resources, class: FileResourceIterator

Package org.apache.tools.ant.types.resources

# Class FileResourceIterator

java.lang.Object
org.apache.tools.ant.types.resources.FileResourceIterator

All Implemented Interfaces:
  `Iterator<Resource>`

public class FileResourceIterator extends Object implements Iterator<Resource>
Iterator of FileResources from filenames.

Since:
  Ant 1.7

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FileResourceIterator()`
  Deprecated.
  in favor of `FileResourceIterator(Project)`
  `FileResourceIterator(File basedir)`
  Deprecated.
  in favor of `FileResourceIterator(Project, File)`
  `FileResourceIterator(File basedir, String[] filenames)`
  Deprecated.
  in favor of `FileResourceIterator(Project, File, String[])`
  `FileResourceIterator(Project project)`
  Create a new FileResourceIterator.
  `FileResourceIterator(Project project, File basedir)`
  Construct a new FileResourceIterator relative to the specified base directory.
  `FileResourceIterator(Project project, File basedir, String[] filenames)`
  Construct a new FileResourceIterator over the specified filenames, relative to the specified base directory.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addFiles(String[] s)`
  Add an array of filenames to this FileResourceIterator.
  `boolean`
  `hasNext()`
  Find out whether this FileResourceIterator has more elements.
  `Resource`
  `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`

  ### Methods inherited from interface java.util.Iterator

  `forEachRemaining`

- ## Constructor Details

  - ### FileResourceIterator

    @Deprecated public FileResourceIterator()
    Deprecated.
    in favor of `FileResourceIterator(Project)`
    Construct a new FileResourceIterator.

  - ### FileResourceIterator

    public FileResourceIterator(Project project)
    Create a new FileResourceIterator.
    Parameters:
      `project` - associated Project instance
    Since:
      Ant 1.8

  - ### FileResourceIterator

    @Deprecated public FileResourceIterator(File basedir)
    Deprecated.
    in favor of `FileResourceIterator(Project, File)`
    Construct a new FileResourceIterator relative to the specified base directory.
    Parameters:
      `basedir` - the base directory of this instance.

  - ### FileResourceIterator

    public FileResourceIterator(Project project, File basedir)
    Construct a new FileResourceIterator relative to the specified base directory.
    Parameters:
      `project` - associated Project instance
      `basedir` - the base directory of this instance.
    Since:
      Ant 1.8

  - ### FileResourceIterator

    @Deprecated public FileResourceIterator(File basedir, String[] filenames)
    Deprecated.
    in favor of `FileResourceIterator(Project, File, String[])`
    Construct a new FileResourceIterator over the specified filenames, relative to the specified base directory.
    Parameters:
      `basedir` - the base directory of this instance.
      `filenames` - the String[] of filenames.

  - ### FileResourceIterator

    public FileResourceIterator(Project project, File basedir, String[] filenames)
    Construct a new FileResourceIterator over the specified filenames, relative to the specified base directory.
    Parameters:
      `project` - associated Project instance
      `basedir` - the base directory of this instance.
      `filenames` - the String[] of filenames.
    Since:
      Ant 1.8

- ## Method Details

  - ### addFiles

    public void addFiles(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 `Iterator<Resource>`
    Returns:
      whether there are more Resources to iterate over.

  - ### next

    public Resource next()
    Get the next element from this FileResourceIterator.
    Specified by:
      `next` in interface `Iterator<Resource>`
    Returns:
      the next Object.

  - ### remove

    public void remove()
    Not implemented.
    Specified by:
      `remove` in interface `Iterator<Resource>`

  - ### nextResource

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