Package com.complexible.common.base
Class HandlerBackedIterator<T>
- java.lang.Object
-
- com.google.common.collect.UnmodifiableIterator<T>
-
- com.google.common.collect.AbstractIterator<T>
-
- com.complexible.common.base.CloseableIterator.AbstractCloseableIterator<T>
-
- com.complexible.common.base.HandlerBackedIterator<T>
-
- All Implemented Interfaces:
CloseableIterator<T>
,java.lang.AutoCloseable
,java.util.Iterator<T>
public class HandlerBackedIterator<T> extends CloseableIterator.AbstractCloseableIterator<T>
An adapter for converting push-based data processing (aka handler-based) to pull-based data processing (aka iterator-based).- Since:
- 7.4.6
- Author:
- Pavel Klinov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
HandlerBackedIterator.DataConsumer<T>
static interface
HandlerBackedIterator.DataProducer<T>
static class
HandlerBackedIterator.ProducerFinished
Can be thrown out ofConsumer.accept(Object)
to indicate that theproducer
must stop generating data.-
Nested classes/interfaces inherited from interface com.complexible.common.base.CloseableIterator
CloseableIterator.AbstractCloseableIterator<T>, CloseableIterator.DelegatingCloseableIterator<T>, CloseableIterator.EmptyCloseableIterator<T>
-
-
Constructor Summary
Constructors Constructor Description HandlerBackedIterator(HandlerBackedIterator.DataProducer<T> producer, java.util.concurrent.ExecutorService execService, CancelCheck cancelCheck, int batchSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected T
computeNext()
-
Methods inherited from class com.google.common.collect.AbstractIterator
endOfData, hasNext, next, peek
-
-
-
-
Constructor Detail
-
HandlerBackedIterator
public HandlerBackedIterator(HandlerBackedIterator.DataProducer<T> producer, java.util.concurrent.ExecutorService execService, CancelCheck cancelCheck, int batchSize)
-
-