import java.util.Enumeration; import java.util.NoSuchElementException; public class StringIterator { public StringIterator (/*@non_null@*/ Enumeration e) //@requires e.elementType == \type(String) ; //@requires e.returnsNull == false ; // effects: Constructs an iterator that will yield each String in e in order. { } public boolean hasNext () // effects: Returns true iff there are more elements to yield. { } public /*@non_null@*/ String next () throws NoSuchElementException // modifies: this // effects: If there are more results to yield, returns the next String and // modifies the state of this to record the yield. Otherwise, throws // NoSuchElementException. { } }