edu.rice.comp211.laundry.iterator
Interface IteratorI<T>

All Superinterfaces:
ReadIteratorI<T>
All Known Subinterfaces:
BiIteratorI<T>

public interface IteratorI<T>
extends ReadIteratorI<T>

An iterator that traverses a collection of elements of type T possibly modifying it. As the iterator traverses the list, the list behaves as if it is circular with a dummy element between the last and first elements.


Method Summary
 void insert(T o)
          Destructively inserts the object o immediately before the current item.
 T remove()
          Removes the current element e.
 
Methods inherited from interface edu.rice.comp211.laundry.iterator.ReadIteratorI
atEnd, atStart, currentItem, first, next
 

Method Detail

insert

void insert(T o)
Destructively inserts the object o immediately before the current item. If the list is empty, or the cursor is atEnd(), the node is inserted immediately before the dummy node of the list.


remove

T remove()
Removes the current element e.

Returns:
the removed element e.
Throws:
IteratorException - if the cursor is atEnd() (at the dummy element).