The Iterator Pattern provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.  It places the task of traversal on the iterator object, not on the aggregate, which simplifies the aggregate interface and implementation, and places the responsibility where it should be.

An example of the Iterator Design Pattern follows:

public class ArrayIterator implements Iterator {
	Object[] items;
	int position = 0;
	
	public ArrayIterator(Object[] items) {
		this.items = items;
	}
	
	public Object next() {
		Object item = items[position];
		position++;
		return item;
	}
	
	public boolean hasNext() {
		if (position >= items.length || items[position] == null) {
			return false;
		} else {
			return true;
		}
	}
		
}