Package jflex.logging
Class StdOutWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.PrintWriter
-
- jflex.logging.StdOutWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.Appendable,java.lang.AutoCloseable
public final class StdOutWriter extends java.io.PrintWriterConvenience class for JFlex stdout, redirects output to a TextArea if in GUI mode.- Version:
- JFlex 1.9.1
-
-
Field Summary
Fields Modifier and Type Field Description private intcolapproximation of the current column in the text area for auto wrapping atwrapcharactersprivate java.awt.TextAreatexttext area to write to if in gui mode, gui mode = (text != null)private static intwrapauto wrap lines in gui mode at this value
-
Constructor Summary
Constructors Constructor Description StdOutWriter()A StdOutWriter, attached to System.out, no gui modeStdOutWriter(java.io.OutputStream out)A StdOutWrite, attached to the specified output stream, no gui mode
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidprintln()Begin a new line.voidsetGUIMode(java.awt.TextArea text)Set the TextArea to write text to.voidwrite(char[] buf, int off, int len)voidwrite(int c)Write a single character.voidwrite(java.lang.String s, int off, int len)-
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, setError, write, write
-
-
-
-
Field Detail
-
text
private java.awt.TextArea text
text area to write to if in gui mode, gui mode = (text != null)
-
col
private int col
approximation of the current column in the text area for auto wrapping atwrapcharacters
-
wrap
private static final int wrap
auto wrap lines in gui mode at this value- See Also:
- Constant Field Values
-
-
Method Detail
-
setGUIMode
public void setGUIMode(java.awt.TextArea text)
Set the TextArea to write text to. Will continue to write to System.out if text isnull.- Parameters:
text- the TextArea to write to
-
write
public void write(int c)
Write a single character.- Overrides:
writein classjava.io.PrintWriter- Parameters:
c- a int.
-
write
public void write(char[] buf, int off, int len)Write a portion of an array of characters.
- Overrides:
writein classjava.io.PrintWriter
-
write
public void write(java.lang.String s, int off, int len)Write a portion of a string.
- Overrides:
writein classjava.io.PrintWriter
-
println
public void println()
Begin a new line. Which actual character/s is/are written depends on the runtime platform.- Overrides:
printlnin classjava.io.PrintWriter
-
-