org.omegahat.Environment.IO
Class InputReader
java.lang.Object
|
+--java.io.Reader
|
+--java.io.BufferedReader
|
+--org.omegahat.Environment.IO.InputReader
- All Implemented Interfaces:
- InputSupplier, java.lang.Runnable
- Direct Known Subclasses:
- NumberedInputReader
- public class InputReader
- extends java.io.BufferedReader
- implements InputSupplier, java.lang.Runnable
The basic user input reader in the console version of omegahat that
is parameterized by a PromptSource
and allows listeners (such as an Evaluator,
command auditor, history list, etc.) to register and be notified of new input.
This is frequently run in a different thread.
| Fields inherited from class java.io.Reader |
lock |
| Methods inherited from class java.io.BufferedReader |
close, mark, markSupported, read, read, readLine, ready, reset, skip |
| Methods inherited from class java.io.Reader |
read |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
current_line
protected java.lang.StringBuffer current_line
consumers
protected java.util.Vector consumers
promptSource
protected PromptSource promptSource
InputReader
public InputReader()
InputReader
public InputReader(PromptSource src)
InputReader
public InputReader(java.io.InputStreamReader in)
InputReader
public InputReader(java.io.InputStream in)
addInputConsumer
public boolean addInputConsumer(InputConsumer cons)
removeInputConsumer
public boolean removeInputConsumer(InputConsumer cons)
getInput
public java.lang.Object getInput()
- Description copied from interface:
InputSupplier
- Read the next object from the input source inherent in the callee.
- Specified by:
getInput in interface InputSupplier
run
public void run()
- Specified by:
run in interface java.lang.Runnable
prompt
public java.lang.String prompt()
notifyConsumers
public void notifyConsumers(java.lang.String text)
promptSource
public PromptSource promptSource()
promptSource
public PromptSource promptSource(PromptSource src)
defaultPrompt
public java.lang.String defaultPrompt()