|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstresstests.datasets.TraversalInFile
public class TraversalInFile
Functional (External) Iterator Pattern: file reader iterator for a list of cities TraversalInFile 22 March 2006
Field Summary | |
---|---|
protected java.io.BufferedReader |
buffer
the input reader |
protected City |
c
a city object to hold values |
protected boolean |
closed
determines whether the general dialog has been closed |
protected java.lang.String |
line
one line of input at a time |
protected boolean |
submitted
determines whether new city data has been submitted |
Constructor Summary | |
---|---|
TraversalInFile()
Select a file from which the data will be read, make sure it can be opened. |
Method Summary | |
---|---|
City |
getFirst()
return the most recent submission - if available |
void |
getnext()
process next item, if available |
Traversal<City> |
getRest()
produce a traversal for the rest of this list |
boolean |
isEmpty()
verify that new submission is available |
static void |
main(java.lang.String[] argv)
Self Test |
void |
read(java.lang.String s)
extract next City object from the input string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.BufferedReader buffer
protected java.lang.String line
protected City c
protected boolean closed
protected boolean submitted
Constructor Detail |
---|
public TraversalInFile()
Method Detail |
---|
public void getnext()
public Traversal<City> getRest()
getRest
in interface Traversal<City>
Traversal
for
the rest of this dataset if available -- otherwise
throws IllegalUseOfTraversalException
public City getFirst()
getFirst
in interface Traversal<City>
IllegalUseOfTraversalException
public boolean isEmpty()
isEmpty
in interface Traversal<City>
public void read(java.lang.String s)
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |