org.jcreme.processing
Class MultiplexedProducer

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

public class MultiplexedProducer
extends AbstractProducer

This producer does nothing but providing an existing object. Its main use is to provide outlets to the ProducerMultiplexer.

Author:
$Author: dbregeon $

Constructor Summary
MultiplexedProducer(int initialProductionQueueSize, int initialValidationQueueSize, ProducerMultiplexer source)
          Creates a new instance of MultiplexedProducer
 
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

MultiplexedProducer

public MultiplexedProducer(int initialProductionQueueSize,
                           int initialValidationQueueSize,
                           ProducerMultiplexer source)
Creates a new instance of MultiplexedProducer

Parameters:
initialProductionQueueSize - the size of the production queue when it is initialized.
initialValidationQueueSize - the size of the validation queue when it is initialized.
source - the multiplixer that provides values to this Producer.
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.