|
ESC/Java2 © 2003,2004,2005,2006 David Cok and Joseph Kiniry © 2005,2006 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjunitutils.LineIterator
This is a utility class that is an iterator over the lines produced by reading a file. It is used in particular by various JUnit tests.
| Field Summary | |
private java.lang.String |
nextLine
The next value to be returned by the iterator. |
private java.io.BufferedReader |
r
A reader that reads lines from the file. |
| Constructor Summary | |
LineIterator(java.lang.String filename)
Starts an iterator reading from the given external process. |
|
| Method Summary | |
boolean |
hasNext()
Per a standard iterator, returns true if there is another value waiting. |
java.lang.Object |
next()
Per a standard iterator, returns the next value - and throws java.util.NoSuchElementException if the list has been exhausted (hasNext() returns false). |
void |
remove()
This operation will throw an exception, as there is no need for remove in this context. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.io.BufferedReader r
private java.lang.String nextLine
| Constructor Detail |
public LineIterator(java.lang.String filename)
throws java.io.IOException
filename - The name of the file to be read| Method Detail |
public boolean hasNext()
throws java.lang.Error
hasNext in interface java.util.Iteratorjava.lang.Error
public java.lang.Object next()
throws java.util.NoSuchElementException,
java.lang.Error
next in interface java.util.Iteratorjava.util.NoSuchElementException
java.lang.Error
public void remove()
throws java.lang.UnsupportedOperationException
remove in interface java.util.Iteratorjava.lang.UnsupportedOperationException
|
ESC/Java2 © 2003,2004,2005,2006 David Cok and Joseph Kiniry © 2005,2006 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||