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

java.lang.Object
  extended by edu.rice.cs.plt.iter.RemoveNotificationIterator<T>
All Implemented Interfaces:
Composite, Iterator<T>

public class RemoveNotificationIterator<T>
extends Object
implements Iterator<T>, Composite

An iterator that notifies a callback whenever an element is removed.


Constructor Summary
RemoveNotificationIterator(Iterator<? extends T> i, Runnable1<? super T> listener)
           
 
Method Summary
 int compositeHeight()
          Get the maximum path length from this node to a leaf.
 int compositeSize()
          Get the number of nodes in the tree rooted at this node.
 boolean hasNext()
           
static
<T> RemoveNotificationIterator<T>
make(Iterator<? extends T> i, Runnable1<? super T> listener)
          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

RemoveNotificationIterator

public RemoveNotificationIterator(Iterator<? extends T> i,
                                  Runnable1<? super T> listener)
Method Detail

compositeHeight

public int compositeHeight()
Description copied from interface: Composite
Get the maximum path length from this node to a leaf.

Specified by:
compositeHeight in interface Composite

compositeSize

public int compositeSize()
Description copied from interface: Composite
Get the number of nodes in the tree rooted at this node. Always 1 or greater.

Specified by:
compositeSize in interface Composite

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>

make

public static <T> RemoveNotificationIterator<T> make(Iterator<? extends T> i,
                                                     Runnable1<? super T> listener)
Call the constructor (allows T to be inferred)