Package org.infinispan.commons.util
Class RemovableIterator<C>
- java.lang.Object
-
- org.infinispan.commons.util.RemovableIterator<C>
-
- All Implemented Interfaces:
Iterator<C>
- Direct Known Subclasses:
RemovableCloseableIterator
public class RemovableIterator<C> extends Object implements Iterator<C>
An Iterator implementation that allows for a Iterator 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 Consumer<? super C>
consumer
protected C
currentValue
protected C
previousValue
protected Iterator<C>
realIterator
-
Constructor Summary
Constructors Constructor Description RemovableIterator(Iterator<C> realIterator, Consumer<? super C> consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected C
getNextFromIterator()
boolean
hasNext()
C
next()
void
remove()
-