wt.util
Class FileConsumer.FileProducer

java.lang.Object
  extended bywt.util.FileConsumer.FileProducer
All Implemented Interfaces:
Consumer.Producer, Runnable
Enclosing class:
FileConsumer

protected static class FileConsumer.FileProducer
extends Object
implements Consumer.Producer

Iterates through a list of files, loading each one into the queue.


Field Summary
private  int currentFile
           
protected  InputStream currentStream
           
private  String[] files
           
private  FileConsumer.FileConsumerQueue queue
           
 
Constructor Summary
FileConsumer.FileProducer(String[] files)
           
 
Method Summary
 void finalize()
           
 String getCurrentFile()
           
 String[] getFiles()
           
 Consumer.Queue getQueue()
           
protected  void loadCurrentStream()
           
 void run()
           
 void setQueue(Consumer.Queue q)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

files

private final String[] files

queue

private FileConsumer.FileConsumerQueue queue

currentFile

private int currentFile

currentStream

protected InputStream currentStream
Constructor Detail

FileConsumer.FileProducer

public FileConsumer.FileProducer(String[] files)
Method Detail

getQueue

public final Consumer.Queue getQueue()
Specified by:
getQueue in interface Consumer.Producer
Returns:
queue The queue that this producer is buffering to.

setQueue

public void setQueue(Consumer.Queue q)
Specified by:
setQueue in interface Consumer.Producer

getFiles

public final String[] getFiles()
Returns:
The list of files to be iterated over.

getCurrentFile

public final String getCurrentFile()
Returns:
The file currently being iterated on or null if all files have been processed.

run

public final void run()
Specified by:
run in interface Runnable

loadCurrentStream

protected void loadCurrentStream()
                          throws IOException
Throws:
IOException

finalize

public void finalize()
Specified by:
finalize in interface Consumer.Producer