James Ring wrote:
I was thinking of an class like this:
public class OpenFileLineIterator implements Iterator {
boolean hasNext();
String nextLine();
void close();
}
Looks fine to me.. Did you intend to use a BufferedReader for the
implementation of nextLine()?
Also, maybe hasNext() will be a bit tricky to determine, because you don't
know if you're at the end of a file until you try reading from it. Maybe this
isn't a problem...
I would expect hasNext to actually read the next line and store it in
the iterator for nextLine() to return. That way its fairly easy to
implement.
Stephen
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]