de.lmu.ifi.dbs.elki.utilities.iterator
Class OneItemIterator<T>

java.lang.Object
  extended by 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.
 
Constructor Summary
OneItemIterator(T object)
          Constructor.
 
Method Summary
 boolean hasNext()
           
 Iterator<T> iterator()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

object

private T object
Object to return.

Constructor Detail

OneItemIterator

public OneItemIterator(T object)
Constructor.

Parameters:
object - Object to return once.
Method Detail

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>

Release 0.4.0 (2011-09-20_1324)