Entwurfsmuster - Iterator (Forts.)
Implementationsskizze in Java:
public interface InventoryIteratorIF{
public boolean hasNextInventoryItem();
public InventoryItem getNextInventoryItem();
public boolean hasPrevInventoryItem();
public InventoryItem getPrevInventoryItem();
} // interface InventoryIteratorIF
public class InventoryCollection{
public InventoryIteratorIF iterator(){
return new InventoryIterator();