org.jcreme.processing
Class FileReaderProducer

java.lang.Object
  extended byorg.jcreme.processing.AbstractProducer
      extended byorg.jcreme.processing.FileReaderProducer
All Implemented Interfaces:
Producer

public class FileReaderProducer
extends AbstractProducer

This producer reads lines from a file. The produced Objects are Strings that represent the lines of the file.

Version:
$Revision: 1.2 $
Author:
$Author: dbregeon $

Constructor Summary
FileReaderProducer(java.io.File file, int initialProductionQueueSize, int initialValidationQueueSize)
          Creates new FileReaderProducer
 
Method Summary
 boolean produceItem()
          Produces next item, i.e. marks it as consumable.
 
Methods inherited from class org.jcreme.processing.AbstractProducer
getItemsBeingConsumed, getProducedItems, isProductionOver, nextItem, nextItem, publishItem, setProductionOver, validateItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileReaderProducer

public FileReaderProducer(java.io.File file,
                          int initialProductionQueueSize,
                          int initialValidationQueueSize)
                   throws java.lang.IllegalArgumentException
Creates new FileReaderProducer

Parameters:
file - The file to read from.
initialProductionQueueSize - the size of the production queue when it is initialized.
initialValidationQueueSize - the size of the validation queue when it is initialized.
Throws:
java.lang.IllegalArgumentException - if a problem occurs accessing the file.
Method Detail

produceItem

public boolean produceItem()
Produces next item, i.e. marks it as consumable.

Specified by:
produceItem in interface Producer
Specified by:
produceItem in class AbstractProducer
Returns:
True if there are still objects to produce, false otherwise.


Copyright 2006 null. All Rights Reserved.