Class RemovableCloseableIterator<C>

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.util.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
    • Constructor Detail

      • RemovableCloseableIterator

        public RemovableCloseableIterator​(CloseableIterator<C> realIterator,
                                          java.util.function.Consumer<? super C> consumer)
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface CloseableIterator<C>