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

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

public class MutableSingletonIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>

An Iterator over a 1-length list that supports removal by delegating to the given listener.


Constructor Summary
MutableSingletonIterator(T element, Runnable1<? super T> removeListener)
           
 
Method Summary
 boolean hasNext()
           
static
<T> MutableSingletonIterator<T>
make(T element, Runnable1<? super T> removeListener)
          Call the constructor (allows T to be inferred)
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableSingletonIterator

public MutableSingletonIterator(T element,
                                Runnable1<? super T> removeListener)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<T>

next

public T next()
Specified by:
next in interface java.util.Iterator<T>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<T>

make

public static <T> MutableSingletonIterator<T> make(T element,
                                                   Runnable1<? super T> removeListener)
Call the constructor (allows T to be inferred)