jay.yydebug

Class yyInputStream

public class yyInputStream extends InputStream implements KeyListener

used to reroute standard input from a java.awt.TextArea. Feeds all read methods from listening to typed keys. Should not deadlock because one should generally not read from within the event thread.

While this implementation uses Java generics, code for a non-generic version has simply been commented out.

Field Summary
protected StringBufferline
line edit buffer.
protected ArrayListqueue
completed lines, ready to be read.
Method Summary
intavailable()
voidclose()
voidkeyPressed(KeyEvent ke)
this one ensures that you can only type at the end.
voidkeyReleased(KeyEvent ke)
voidkeyTyped(KeyEvent ke)
intread()
intread(byte[] b, int off, int len)
longskip(long len)
returns 0: cannot skip on a terminal.

Field Detail

line

protected final StringBuffer line
line edit buffer.

queue

protected ArrayList queue
completed lines, ready to be read. Invariant: null after yyInputStream.

Method Detail

available

public int available()

close

public void close()

keyPressed

public void keyPressed(KeyEvent ke)
this one ensures that you can only type at the end. This is executed within the event thread.

keyReleased

public void keyReleased(KeyEvent ke)

keyTyped

public void keyTyped(KeyEvent ke)

read

public int read()

read

public int read(byte[] b, int off, int len)

skip

public long skip(long len)
returns 0: cannot skip on a terminal.