java.lang.Object
java.io.Writer
java.io.PrintWriter
com.aoapps.hodgepodge.io.TerminalWriter
- All Implemented Interfaces:
NoClose,Closeable,Flushable,Appendable,AutoCloseable
A writer that controls advanced features of
VT/100 terminals, while silently reverting to standard
behavior where the functions are not supported.
- Author:
- AO Industries, Inc.
-
Field Summary
Fields inherited from class java.io.PrintWriter
out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidboldOn()voidbooleanbooleanstatic booleanprogressOutput(String lastVerboseString, String newVerboseString) static StringprogressOutput(String lastVerboseString, String newVerboseString, PrintStream out) (Over)writes a progress line to the given PrintStream.static StringprogressOutput(String lastVerboseString, String newVerboseString, Writer out) (Over)writes a progress line to the given PrintStream.voidsetEnabled(boolean enabled) Enables the special features of the terminal writer.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, println, setError, write, write, write, write, writeMethods inherited from class java.io.Writer
nullWriter
-
Constructor Details
-
TerminalWriter
-
TerminalWriter
-
-
Method Details
-
isSupported
public static boolean isSupported() -
progressOutput
public static String progressOutput(String lastVerboseString, String newVerboseString, PrintStream out) (Over)writes a progress line to the given PrintStream. Any extra characters from previous output are covered with spaces. Any common prefix is not overwritten.- Parameters:
lastVerboseString- The last line outputnewVerboseString- The new line to display- Returns:
- The new line (newVerboseString)
-
progressOutput
public static String progressOutput(String lastVerboseString, String newVerboseString, Writer out) throws IOException (Over)writes a progress line to the given PrintStream. Any extra characters from previous output are covered with spaces. Any common prefix is not overwritten.- Parameters:
lastVerboseString- The last line outputnewVerboseString- The new line to display- Returns:
- The new line (newVerboseString)
- Throws:
IOException
-
isNoClose
public boolean isNoClose() -
attributesOff
- Throws:
IOException
-
boldOn
- Throws:
IOException
-
clearScreen
- Throws:
IOException
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) Enables the special features of the terminal writer. -
progressOutput
- Throws:
IOException- See Also:
-
