edu.rice.cs.plt.iter
Class SingletonIterator<T>

java.lang.Object
  extended by edu.rice.cs.plt.iter.ReadOnlyIterator<T>
      extended by edu.rice.cs.plt.iter.SingletonIterator<T>
All Implemented Interfaces:
Iterator<T>

public class SingletonIterator<T>
extends ReadOnlyIterator<T>

An Iterator over a 1-length list


Constructor Summary
SingletonIterator(T element)
           
 
Method Summary
 boolean hasNext()
           
static
<T> SingletonIterator<T>
make(T element)
          Call the constructor (allows T to be inferred)
 T next()
           
 
Methods inherited from class edu.rice.cs.plt.iter.ReadOnlyIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonIterator

public SingletonIterator(T element)
Method Detail

hasNext

public boolean hasNext()

next

public T next()

make

public static <T> SingletonIterator<T> make(T element)
Call the constructor (allows T to be inferred)