org.apache.commons.jelly.tags.ant
Class FileIterator

java.lang.Object
  extended byorg.apache.commons.jelly.tags.ant.FileIterator
All Implemented Interfaces:
java.util.Iterator

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

FileIterator is an iterator over a over a number of files from a colleciton of FileSet instances.

Version:
$Revision: 1.4 $
Author:
James Strachan

Field Summary
private  org.apache.tools.ant.DirectoryScanner ds
          The directory scanner
private  int fileIndex
          The current index into the file name array
private  java.lang.String[] files
          The file names in the current FileSet scan
private  java.util.Iterator fileSetIterator
          The iterator over the FileSet objects
private  boolean iterateDirectories
          Return only directories?
private  java.io.File nextFile
          The next File object we'll iterate over
private  boolean nextObjectSet
          Have we set a next object?
private  org.apache.tools.ant.Project project
          The Ant project
 
Constructor Summary
FileIterator(org.apache.tools.ant.Project project, java.util.Iterator fileSetIterator)
           
FileIterator(org.apache.tools.ant.Project project, java.util.Iterator fileSetIterator, boolean iterateDirectories)
           
 
Method Summary
 boolean hasNext()
           
 java.lang.Object next()
           
 void remove()
          throws UnsupportedOperationException
private  boolean setNextObject()
          Set nextObject to the next object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileSetIterator

private java.util.Iterator fileSetIterator
The iterator over the FileSet objects


project

private org.apache.tools.ant.Project project
The Ant project


ds

private org.apache.tools.ant.DirectoryScanner ds
The directory scanner


files

private java.lang.String[] files
The file names in the current FileSet scan


fileIndex

private int fileIndex
The current index into the file name array


nextFile

private java.io.File nextFile
The next File object we'll iterate over


nextObjectSet

private boolean nextObjectSet
Have we set a next object?


iterateDirectories

private boolean iterateDirectories
Return only directories?

Constructor Detail

FileIterator

public FileIterator(org.apache.tools.ant.Project project,
                    java.util.Iterator fileSetIterator)

FileIterator

public FileIterator(org.apache.tools.ant.Project project,
                    java.util.Iterator fileSetIterator,
                    boolean iterateDirectories)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator
Returns:
true if there is another object that matches the given predicate

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator
Returns:
the next object which matches the given predicate

remove

public void remove()
throws UnsupportedOperationException

Specified by:
remove in interface java.util.Iterator

setNextObject

private boolean setNextObject()
Set nextObject to the next object. If there are no more objects then return false. Otherwise, return true.