Class IteratorMapper<E,S>

java.lang.Object
org.infinispan.commons.util.IteratorMapper<E,S>
All Implemented Interfaces:
AutoCloseable, Iterator<S>, CloseableIterator<S>

public class IteratorMapper<E,S> extends Object implements CloseableIterator<S>
A iterator that maps each value to the output of the Function. Note that the remove is supported if the iterator originally supported remove. This iterator implements CloseableIterator and will close the provided iterator if it also implemented CloseableIterator.
Since:
8.0
Author:
William Burns
  • Constructor Summary

    Constructors
    Constructor
    Description
    IteratorMapper(Iterator<? extends E> iterator, Function<? super E,? extends S> function)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    boolean
     
     
    void
     
  • Constructor Details

    • IteratorMapper

      public IteratorMapper(Iterator<? extends E> iterator, Function<? super E,? extends S> function)
  • Method Details

    • hasNext

      public boolean hasNext()
    • next

      public S next()
    • remove

      public void remove()
    • close

      public void close()
      Specified by:
      close in interface CloseableIterator<E>