INRIA & FluxMedia

fr.fluxmedia.transmorpher.stdlib
Class FileIterator

java.lang.Object
  extended by fr.fluxmedia.transmorpher.stdlib.FileIterator
All Implemented Interfaces:
TIterator, java.util.Enumeration

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
private  java.lang.String type
           
 
Constructor Summary
FileIterator(java.lang.String n, Parameters p)
          The constructor
 
Method Summary
 java.lang.String getName()
           
 java.lang.String getType()
           
 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, 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


type

private java.lang.String type
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()
Specified by:
getName in interface TIterator

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.

getType

public java.lang.String getType()
Specified by:
getType in interface TIterator

INRIA & FluxMedia

..no bottom yet...