All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cantaa.util.EmptyIterator Maven / Gradle / Ivy

There is a newer version: 2.0
Show newest version
package com.cantaa.util;

import java.util.Iterator;
import java.util.NoSuchElementException;

/**
 * Empty iterator
 * @author Hans Lesmeister
 */
public class EmptyIterator implements Iterator {

   public boolean hasNext() {
      return false;
   }

   public T next() {
      throw new NoSuchElementException("Iterator is empty");
   }

   public void remove() {
      throw new NoSuchElementException("Iterator is empty");
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy