de.lmu.ifi.dbs.elki.utilities.iterator
Class OneItemIterator<T>
java.lang.Object
de.lmu.ifi.dbs.elki.utilities.iterator.OneItemIterator<T>
- Type Parameters:
T
- Object type to return
- All Implemented Interfaces:
- IterableIterator<T>, Iterable<T>, Iterator<T>
public class OneItemIterator<T>
- extends Object
- implements IterableIterator<T>
Dummy iterator/iterable that returns a single object, once.
Note: a "null" object is not supported.
Field Summary |
private T |
object
Object to return. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
object
private T object
- Object to return.
OneItemIterator
public OneItemIterator(T object)
- Constructor.
- Parameters:
object
- Object to return once.
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<T>
next
public T next()
- Specified by:
next
in interface Iterator<T>
remove
public void remove()
- Specified by:
remove
in interface Iterator<T>
iterator
public Iterator<T> iterator()
- Specified by:
iterator
in interface Iterable<T>