gnu.mapping
Class TtyInPort
- Printable
An interactive input-port.
Supports prompting, auto-flush of tied output port, transcripts.
close , fill , getColumnNumber , getConvertCR , getLineNumber , getName , getPath , getReadState , incrLineNumber , lineStart , mark , markSupported , peek , read , read , readLine , readLine , ready , reset , setBuffer , setConvertCR , setKeepFullLines , setLineNumber , setName , setPath , skip , skip , skipRestOfLine , skip_quick , unread , unread_quick |
promptEmitted
protected boolean promptEmitted
TtyInPort
public TtyInPort(InputStream in,
Path name,
OutPort tie)
TtyInPort
public TtyInPort(Reader in,
Path name,
OutPort tie)
getPrompter
public Procedure getPrompter()
Get the current prompter function.
read
public int read(cbuf[] ,
int off,
int len)
throws IOException
setPrompter
public void setPrompter(Procedure prompter)
Set the prompter function.
The argument is called when a new line is read.
It is passed one argument (this input port), and should return
a string. That string is printed as the prompt string.