|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jcreme.processing.DefaultConsumer
Default implementation of the Consumer interface. This basically the only implementation needed that refers directly to the provider. Other implementation of the Consumer Interface will probably simply aggregate an instance of this class.
Consumer,
Producer| Constructor Summary | |
DefaultConsumer(Producer provider)
Creates new DefaultConsumer |
|
| Method Summary | |
java.lang.Object |
consumeItem()
Consumes a new item. |
Producer |
getProvider()
eturns the producer associated with the consumer. |
void |
setProvider(Producer provider)
Sets the producer whose objects the consumer will consume. |
boolean |
validateItem(java.lang.Object item)
Tells the parent producer that this consumer has finished with this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultConsumer(Producer provider)
throws java.lang.IllegalArgumentException
provider - The provider of the DefaultConsumer.
java.lang.IllegalArgumentException - if provider is null.| Method Detail |
public Producer getProvider()
getProvider in interface ConsumerConsumer.getProvider()public java.lang.Object consumeItem()
consumeItem in interface ConsumerConsumer.consumeItem()public boolean validateItem(java.lang.Object item)
validateItem in interface Consumeritem - an item that was previously retrieved through the consumeItem
method.
public void setProvider(Producer provider)
throws java.lang.IllegalArgumentException
setProvider in interface Consumerprovider - The producer to be set.
java.lang.IllegalArgumentException - In case the type of the given producer doesn't match the
expected type.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||