Class RemovableIterator<C>

java.lang.Object
org.infinispan.commons.util.RemovableIterator<C>
All Implemented Interfaces:
Iterator<C>
Direct Known Subclasses:
RemovableCloseableIterator, RemovableIterator

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 Details Link icon

    • realIterator Link icon

      protected final Iterator<C> realIterator
    • consumer Link icon

      protected final Consumer<? super C> consumer
    • previousValue Link icon

      protected C previousValue
    • currentValue Link icon

      protected C currentValue
  • Constructor Details Link icon

    • RemovableIterator Link icon

      public RemovableIterator(Iterator<C> realIterator, Consumer<? super C> consumer)
  • Method Details Link icon

    • getNextFromIterator Link icon

      protected C getNextFromIterator()
    • hasNext Link icon

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<C>
    • next Link icon

      public C next()
      Specified by:
      next in interface Iterator<C>
    • remove Link icon

      public void remove()
      Specified by:
      remove in interface Iterator<C>