org.jcreme.processing
Class FilesReaderProducer

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

public class FilesReaderProducer
extends AbstractProducer

This producer enables to process files into line (much like the FileReaderProducer). It uses a Consumer to get the files to process.

Version:
$Revision: 1.4 $
Author:
$Author: dbregeon $

Constructor Summary
FilesReaderProducer(int initialProductionQueueSize, int initialValidationQueueSize, Consumer fileSource)
          Creates new FilesReaderProducer
 
Method Summary
 boolean produceItem()
          Produces an item, i.e. marks it as consumable.
 boolean validateItem(java.lang.Object theItem)
          Validates an item, i.e. marks it as having been consumed.
 
Methods inherited from class org.jcreme.processing.AbstractProducer
getItemsBeingConsumed, getProducedItems, isProductionOver, nextItem, nextItem, publishItem, setProductionOver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilesReaderProducer

public FilesReaderProducer(int initialProductionQueueSize,
                           int initialValidationQueueSize,
                           Consumer fileSource)
                    throws java.lang.IllegalArgumentException
Creates new FilesReaderProducer

Parameters:
initialProductionQueueSize - the size of the production queue when it is initialized.
initialValidationQueueSize - the size of the validation queue when it is initialized.
fileSource - the source of the files.
Throws:
java.lang.IllegalArgumentException - if fileSource is null.
Method Detail

produceItem

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

Specified by:
produceItem in interface Producer
Specified by:
produceItem in class AbstractProducer
Returns:
true if the method actually produced an item, false otherwise.
See Also:
Producer.produceItem()

validateItem

public boolean validateItem(java.lang.Object theItem)
Validates an item, i.e. marks it as having been consumed. The method then validates the object that enabled to produce the item in the source consumer.

Specified by:
validateItem in interface Producer
Overrides:
validateItem in class AbstractProducer
Parameters:
theItem - The item to be validated.
Returns:
true if theItem was successfully validated.
See Also:
Producer.validateItem(java.lang.Object)


Copyright 2006 null. All Rights Reserved.