Iterators
- Use standard Iterator interface type
public interface Iterator
{
boolean hasNext();
Object next();
void remove();
}
- remove is "optional operation" (see ch.
8)
- implement to throw UnsupportedException
- implement hasNext/next manually to show inner
workings
- Ch5/invoice/Invoice.java
previous |
start |
next .... [Slide 65] ....