Package org.infinispan.commons.util
Class RemovableCloseableIterator<C>
- java.lang.Object
-
- org.infinispan.commons.util.RemovableIterator<C>
-
- org.infinispan.commons.util.RemovableCloseableIterator<C>
-
- All Implemented Interfaces:
AutoCloseable
,Iterator<C>
,CloseableIterator<C>
public class RemovableCloseableIterator<C> extends RemovableIterator<C> implements CloseableIterator<C>
A CloseableIterator implementation that allows for a CloseableIterator that doesn't allow remove operations to implement remove by delegating the call to the provided consumer to remove the previously read value.- Since:
- 9.1
- Author:
- wburns
-
-
Field Summary
Fields Modifier and Type Field Description protected CloseableIterator<C>
realIterator
-
Fields inherited from class org.infinispan.commons.util.RemovableIterator
consumer, currentValue, previousValue
-
-
Constructor Summary
Constructors Constructor Description RemovableCloseableIterator(CloseableIterator<C> realIterator, Consumer<? super C> consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
-
Methods inherited from class org.infinispan.commons.util.RemovableIterator
getNextFromIterator, hasNext, next, remove
-
-
-
-
Field Detail
-
realIterator
protected final CloseableIterator<C> realIterator
-
-
Constructor Detail
-
RemovableCloseableIterator
public RemovableCloseableIterator(CloseableIterator<C> realIterator, Consumer<? super C> consumer)
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceCloseableIterator<C>
-
-