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

void
println()
Begin a new line.
void
setGUIMode(TextArea text)
Set the TextArea to write text to.
void
write(String s, int off, int len)
Write a portion of a string.
void
write(buf[] , int off, int len)
Write a portion of an array of characters.
void
write(int c)
Write a single character.

Constructor Details

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 Details

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(String s,
                  int off,
                  int len)
Write a portion of a string.

write

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

write

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