// © Copyright 1997, Joseph Bergin. All rights reserved.package algo;/*** Iterator is similar to an Enumeration, though it works with for loops.* A typical use:<pre><code>*	for(Iterator i = someCollection.begin(); !i.equal(someCollection.end()); i.advance())*		doSomethingWith(i.thisElement());* </code></pre>*/public interface Iterator extends Cloneable{			/**		* Advance to the next element in the container		* @return the new location		*/		Iterator advance();				/**		* Return the current element of the container.		* @return the current element		*/		Object get();				/**		* Set the current element to the parameter		* @param o the new value at this location		*/		void set(Object o);				/** Does this reference the same location in the container?		* @param i the iterator to be compared with		*/		boolean equals(Iterator i);				/** Move this to the position of i.		* @param the position to move to		*/		void moveTo(Iterator i);				/** Return a new iterator to the same location. */		Object clone();		}