gshute.ioutil
Class InteractiveLineSource
java.lang.Object
|
+--gshute.ioutil.LineSource
|
+--gshute.ioutil.InteractiveLineSource
- public class InteractiveLineSource
- extends LineSource
An InteractiveLineSource dispenses LineScanners for lines read from the
terminal.
Field Summary |
protected java.lang.String |
prompt
prompt is the prompt used by this InteractiveLineSource. |
protected static java.io.BufferedReader |
terminal
terminal is the BufferedReader used by all InteractiveLineSources
as an input stream. |
Method Summary |
LineScanner |
current()
src.current() returns the line at the current position of src. |
protected void |
initialize()
strm.initialize() establishes the InteractiveLineSource starting
conditions for strm. |
protected void |
validateCurrentLine()
strm.validateCurrentLine() ensures that currentLine is the line at
the current position in strm. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
prompt
protected java.lang.String prompt
- prompt is the prompt used by this InteractiveLineSource.
terminal
protected static java.io.BufferedReader terminal
- terminal is the BufferedReader used by all InteractiveLineSources
as an input stream.
current
public LineScanner current()
throws java.io.IOException,
java.lang.IllegalArgumentException
- src.current() returns the line at the current position of src.
Precondition: src.more() is true.
- Overrides:
- current in class LineSource
validateCurrentLine
protected void validateCurrentLine()
throws java.io.IOException
- strm.validateCurrentLine() ensures that currentLine is the line at
the current position in strm. The line at the end of file position
is a null object.
For an InteractiveLineSource, a prompt should be issued before the
line is validated.
- Overrides:
- validateCurrentLine in class LineSource
initialize
protected void initialize()
throws java.io.IOException,
java.io.FileNotFoundException
- strm.initialize() establishes the InteractiveLineSource starting
conditions for strm.
- Overrides:
- initialize in class LineSource