INRIA & FluxMedia

fr.fluxmedia.transmorpher.stdlib
Class fileIterator

java.lang.Object
  |
  +--fr.fluxmedia.transmorpher.stdlib.fileIterator
All Implemented Interfaces:
java.util.Enumeration, TIterator

public final class fileIterator
extends java.lang.Object
implements TIterator

This iterator returns all the files contained by a directory..

Author:
triolet

Field Summary
private  java.lang.String dir
          directory name
private  java.util.Vector files
          an array of file names
private  java.io.FilenameFilter filter
          filter for file names
private  int index
          index of filenames array
private  java.lang.String name
          iterator name
private  Parameters param
          iterator parameters
private  java.lang.String recursive
          recursive search of files
private  java.lang.String sort
          flag for sort files
private  java.lang.String suffix
          suffix for filter
 
Constructor Summary
fileIterator(java.lang.String n, Parameters p)
          The constructor
 
Method Summary
 java.lang.String getName()
           
 boolean hasMoreElements()
          Tests if this iterator has more elements.
 void init(Parameters p)
          The initializer
private  void listDirectory(java.lang.String directory)
          Stores all the file names of a directory in an array.
 java.lang.Object nextElement()
          Returns the next file name..
 void staticInit(Parameters p)
          Static initialization is currently not used
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

param

private Parameters param
iterator parameters

name

private java.lang.String name
iterator name

index

private int index
index of filenames array

dir

private java.lang.String dir
directory name

suffix

private java.lang.String suffix
suffix for filter

recursive

private java.lang.String recursive
recursive search of files

sort

private java.lang.String sort
flag for sort files

filter

private java.io.FilenameFilter filter
filter for file names

files

private java.util.Vector files
an array of file names
Constructor Detail

fileIterator

public fileIterator(java.lang.String n,
                    Parameters p)
The constructor
Parameters:
n - the name of this iterator
p - the parameters of this itterator
Method Detail

staticInit

public void staticInit(Parameters p)
Static initialization is currently not used
Specified by:
staticInit in interface TIterator
Parameters:
p - the parameters of this iterator

init

public void init(Parameters p)
The initializer
Specified by:
init in interface TIterator
Parameters:
p - The parameters of this iterator

listDirectory

private void listDirectory(java.lang.String directory)
Stores all the file names of a directory in an array. This method is not recursive yet.
Parameters:
directory - The directory to explore.

getName

public java.lang.String getName()

hasMoreElements

public final boolean hasMoreElements()
Tests if this iterator has more elements. If not, returns false.
Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if has more elements, else false.

nextElement

public final java.lang.Object nextElement()
Returns the next file name..
Specified by:
nextElement in interface java.util.Enumeration
Returns:
The next file name.

INRIA & FluxMedia

..no bottom yet...