Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.infinispan.commons.util;
 
This is a simple bridge class to change a plain java.util.Iterator into a CloseableIterator where the close method does nothing

Author(s):
wburns
Since:
7.0
public class IteratorAsCloseableIterator<E> implements CloseableIterator<E> {
   private final Iterator<E> iterator;
   public IteratorAsCloseableIterator(Iterator<E> iterator) {
      this. = iterator;
   }
   @Override
   public void close() {
      // This does nothing
   }
   @Override
   public boolean hasNext() {
      return .hasNext();
   }
   @Override
   public E next() {
      return .next();
   }
   @Override
   public void remove() {
      .remove();
   }
New to GrepCode? Check out our FAQ X