|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.streaming.ConsumerIterator<T>
public class ConsumerIterator<T>
Implementation of Iterator
that takes its elements from a Consumer
. This iterator also implements Closeable
. Closing this iterator will
cause the underlying consumer to be closed. If for any reason the underlying
consumer gets closed (either because this iterator closed it or some other
reason), then this iterator will consider that it has not next items.
#Iterator.remove()
operation is not allowed on this instance
Constructor Summary | |
---|---|
ConsumerIterator(Consumer<T> consumer)
|
Method Summary | |
---|---|
void |
close()
Closes the underlying consumer |
boolean |
hasNext()
Returns true as long as the underlying consumer is not fully consumed nor closed |
T |
next()
Gets an item from the consumer and returns it |
void |
remove()
Not allowed on this implementations |
int |
size()
returns the total amount of items available for storage/processing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConsumerIterator(Consumer<T> consumer)
Method Detail |
---|
public void close() throws MuleException
close
in interface Closeable
MuleException
- if an exception occurs closing the resourcepublic boolean hasNext()
hasNext
in interface Iterator<T>
public T next()
next
in interface Iterator<T>
public void remove()
remove
in interface Iterator<T>
UnsupportedOperationException
public int size()
ProvidesTotalHint
size
in interface ProvidesTotalHint
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |