JFlex

Class StdOutWriter

public final class StdOutWriter extends PrintWriter

Convenience class for JFlex stdout, redirects output to a TextArea if in GUI mode.
Constructor Summary
StdOutWriter()
A StdOutWriter, attached to System.out, no gui mode
StdOutWriter(OutputStream out)
A StdOutWrite, attached to the specified output stream, no gui mode
Method Summary
voidprintln()
Begin a new line.
voidsetGUIMode(TextArea text)
Set the TextArea to write text to.
voidwrite(int c)
Write a single character.
voidwrite(char[] buf, int off, int len)
Write a portion of an array of characters.
voidwrite(String s, int off, int len)
Write a portion of a string.

Constructor Detail

StdOutWriter

public StdOutWriter()
A StdOutWriter, attached to System.out, no gui mode

StdOutWriter

public StdOutWriter(OutputStream out)
A StdOutWrite, attached to the specified output stream, no gui mode

Method Detail

println

public void println()
Begin a new line. Which actual character/s is/are written depends on the runtime platform.

setGUIMode

public void setGUIMode(TextArea text)
Set the TextArea to write text to. Will continue to write to System.out if text is null.

Parameters: text the TextArea to write to

write

public void write(int c)
Write a single character.

write

public void write(char[] buf, int off, int len)
Write a portion of an array of characters.

write

public void write(String s, int off, int len)
Write a portion of a string.