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

edu.stanford.nlp.util.AbstractIterator Maven / Gradle / Ivy

package edu.stanford.nlp.util;

import java.util.Iterator;

/**
 * Iterator with remove() defined to throw an
 * UnsupportedOperationException.
 */
public abstract class AbstractIterator implements Iterator {

  /** {@inheritDoc} */
  @Override
  public abstract boolean hasNext();

  /** {@inheritDoc} */
  @SuppressWarnings("IteratorNextCanNotThrowNoSuchElementException")
  @Override
  public abstract E next();

  /**
   * Throws an UnsupportedOperationException.
   */
  @Override
  public void remove() {
    throw new UnsupportedOperationException();
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy