
org.ontoware.aifbcommons.collection.ClosableIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rdf2go.api Show documentation
Show all versions of rdf2go.api Show documentation
RDF2go is an implementation-independent Java API with the design
goals: portability (hence the name), performance and ease of
implementation.
This project was started at FZI Forschungszentrum Informatik Karlsruhe, Germany - www.fzi.de
The newest version!
/**
* LICENSE INFORMATION
*
* Copyright 2005-2008 by FZI (http://www.fzi.de). Licensed under a BSD license
* (http://www.opensource.org/licenses/bsd-license.php) = Max Völkel
* = FZI Forschungszentrum Informatik Karlsruhe, Karlsruhe,
* Germany = 2010
*
* Further project information at http://semanticweb.org/wiki/RDF2Go
*/
package org.ontoware.aifbcommons.collection;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* An closabel iterator over a collection. Iterator takes the place of
* Enumeration in the Java collections framework.
*
* @author Josh Bloch, adapter by Max Voelkel
* @see java.util.Collection
* @see java.util.ListIterator
* @see java.util.Enumeration
*/
public interface ClosableIterator extends Iterator {
/**
* Returns true if the iteration has more elements. (In other
* words, returns true if next would return an element
* rather than throwing an exception.)
*
* @return true if the iterator has more elements.
*/
@Override
boolean hasNext();
/**
* Returns the next element in the iteration. Calling this method repeatedly
* until the {@link #hasNext()} method returns false will return each
* element in the underlying collection exactly once.
*
* @return the next element in the iteration.
* @exception NoSuchElementException iteration has no more elements.
*/
@Override
E next();
/**
*
* Removes from the underlying collection the last element returned by the
* iterator (optional operation). This method can be called only once per
* call to next. The behavior of an iterator is unspecified if the
* underlying collection is modified while the iteration is in progress in
* any way other than by calling this method.
*
* @exception UnsupportedOperationException if the remove operation
* is not supported by this Iterator.
*
* @exception IllegalStateException if the next method has not yet
* been called, or the remove method has already
* been called after the last call to the next
* method.
*/
@Override
void remove();
/**
* The uderlying implementation frees resources. For some it is absolutely
* necessary to call this method.
*/
void close();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy