Package org.jline.terminal.impl
Class DumbTerminal
- java.lang.Object
-
- org.jline.terminal.impl.AbstractTerminal
-
- org.jline.terminal.impl.DumbTerminal
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
,Terminal
public class DumbTerminal extends AbstractTerminal
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jline.terminal.Terminal
Terminal.MouseTracking, Terminal.Signal, Terminal.SignalHandler
-
-
Field Summary
Fields Modifier and Type Field Description private Attributes
attributes
private NonBlockingInputStream
input
private java.io.OutputStream
output
private NonBlockingReader
reader
private Size
size
private java.io.PrintWriter
writer
-
Fields inherited from class org.jline.terminal.impl.AbstractTerminal
bools, encoding, handlers, ints, name, onClose, palette, status, strings, type
-
Fields inherited from interface org.jline.terminal.Terminal
TYPE_DUMB, TYPE_DUMB_COLOR
-
-
Constructor Summary
Constructors Constructor Description DumbTerminal(java.io.InputStream in, java.io.OutputStream out)
DumbTerminal(java.lang.String name, java.lang.String type, java.io.InputStream in, java.io.OutputStream out, java.nio.charset.Charset encoding)
DumbTerminal(java.lang.String name, java.lang.String type, java.io.InputStream in, java.io.OutputStream out, java.nio.charset.Charset encoding, Terminal.SignalHandler signalHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Attributes
getAttributes()
Returns the terminal attributes.Size
getSize()
Retrieve the size of the visible windowjava.io.InputStream
input()
Retrieve the input stream for this terminal.java.io.OutputStream
output()
Retrieve the output stream for this terminal.NonBlockingReader
reader()
Retrieve theReader
for this terminal.void
setAttributes(Attributes attr)
Set the terminal attributes.void
setSize(Size sz)
java.io.PrintWriter
writer()
Retrieve theWriter
for this terminal.-
Methods inherited from class org.jline.terminal.impl.AbstractTerminal
canPauseResume, checkInterrupted, close, doClose, echo, echo, echoSignal, encoding, enterRawMode, flush, getBooleanCapability, getCursorPosition, getKind, getName, getNumericCapability, getPalette, getStatus, getStatus, getStringCapability, getType, handle, hasFocusSupport, hasMouseSupport, parseInfoCmp, pause, pause, paused, puts, raise, readMouseEvent, readMouseEvent, resume, setOnClose, trackFocus, trackMouse
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jline.terminal.Terminal
getBufferSize, getHeight, getWidth
-
-
-
-
Field Detail
-
input
private final NonBlockingInputStream input
-
output
private final java.io.OutputStream output
-
reader
private final NonBlockingReader reader
-
writer
private final java.io.PrintWriter writer
-
attributes
private final Attributes attributes
-
size
private final Size size
-
-
Constructor Detail
-
DumbTerminal
public DumbTerminal(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
DumbTerminal
public DumbTerminal(java.lang.String name, java.lang.String type, java.io.InputStream in, java.io.OutputStream out, java.nio.charset.Charset encoding) throws java.io.IOException
- Throws:
java.io.IOException
-
DumbTerminal
public DumbTerminal(java.lang.String name, java.lang.String type, java.io.InputStream in, java.io.OutputStream out, java.nio.charset.Charset encoding, Terminal.SignalHandler signalHandler) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
reader
public NonBlockingReader reader()
Description copied from interface:Terminal
Retrieve theReader
for this terminal. This is the standard way to read input from this terminal. The reader is non blocking.- Returns:
- The non blocking reader
-
writer
public java.io.PrintWriter writer()
Description copied from interface:Terminal
Retrieve theWriter
for this terminal. This is the standard way to write to this terminal.- Returns:
- The writer
-
input
public java.io.InputStream input()
Description copied from interface:Terminal
Retrieve the input stream for this terminal. In some rare cases, there may be a need to access the terminal input stream directly. In the usual cases, use theTerminal.reader()
instead.- Returns:
- The input stream
- See Also:
Terminal.reader()
-
output
public java.io.OutputStream output()
Description copied from interface:Terminal
Retrieve the output stream for this terminal. In some rare cases, there may be a need to access the terminal output stream directly. In the usual cases, use theTerminal.writer()
instead.- Returns:
- The output stream
- See Also:
Terminal.writer()
-
getAttributes
public Attributes getAttributes()
Description copied from interface:Terminal
Returns the terminal attributes. The returned object can be safely modified further used in a call toTerminal.setAttributes(Attributes)
.- Returns:
- the terminal attributes.
-
setAttributes
public void setAttributes(Attributes attr)
Description copied from interface:Terminal
Set the terminal attributes. The terminal will perform a copy of the given attributes.- Parameters:
attr
- the new attributes
-
getSize
public Size getSize()
Description copied from interface:Terminal
Retrieve the size of the visible window- Returns:
- the visible terminal size
- See Also:
Terminal.getBufferSize()
-
setSize
public void setSize(Size sz)
-
-