public interface Terminal
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the screen.
|
void |
close()
Closes the terminal.
|
void |
flush()
Sends all characters in the buffer (if any) to the terminal.
|
int |
get()
Returns the next character sent by the terminal, or -1 if the stream
is closed.
|
int |
get(byte[] buf)
Reads some characters from the terminal and writes them to buffer 'buf'
starting from position 0, and returns the number of characters read,
or -1 if the stream is closed.
|
int |
get(byte[] buf,
int off,
int len)
Reads up to 'len' characters from the terminal and writes them to buffer 'buf'
starting from position 'off', and returns the number of characters read,
or -1 if the stream is closed.
|
int |
getColumns()
Returns the number of columns in the terminal emulator window.
|
int |
getRows()
Returns the number of rows in the terminal emulator window.
|
void |
move(int row,
int column)
Sends the terminal emulator a command to move the cursor
to the given row and column.
|
void |
put(byte c)
Writes one character to the terminal.
|
void |
put(byte[] buf)
Writes buffer 'buf' to the terminal.
|
void |
put(byte[] buf,
int off,
int len)
Writes 'len' characters to the terminal, starting from position 'off'.
|
void |
put(char c)
Writes one character to the terminal.
|
void |
put(int c)
Writes one character to the terminal.
|
void |
put(int row,
int column,
byte c)
Moves the cursor and writes one character to the terminal.
|
void |
put(int row,
int column,
byte[] buf)
Moves the cursor and writes buffer 'buf' to the terminal.
|
void |
put(int row,
int column,
byte[] buf,
int off,
int len)
Moves the cursor and writes 'len' characters to the terminal,
starting from position 'off'.
|
void |
put(int row,
int column,
char c)
Moves the cursor and writes one character to the terminal.
|
void |
put(int row,
int column,
int c)
Moves the cursor and writes one character to the terminal.
|
void |
put(int row,
int column,
String s)
Moves the cursor and writes a string to the terminal.
|
void |
put(String s)
Writes a string to the terminal.
|
void |
setCursor(boolean on)
Turns the terminal emulator's cursor on or off.
|
void setCursor(boolean on) throws IOException
IOException
void clear() throws IOException
IOException
int getRows()
int getColumns()
int get() throws IOException
IOException
int get(byte[] buf) throws IOException
IOException
int get(byte[] buf, int off, int len) throws IOException
IOException
void put(byte[] buf, int off, int len) throws IOException
IOException
void put(byte[] buf) throws IOException
IOException
void put(String s) throws IOException
IllegalArgumentException
- if the end of string would be outside the windowIOException
void put(int c) throws IOException
IOException
void put(char c) throws IOException
IOException
void put(byte c) throws IOException
IOException
void put(int row, int column, byte[] buf, int off, int len) throws IOException
IllegalArgumentException
- if the coordinates are out of rangeIOException
void put(int row, int column, byte[] buf) throws IOException
IllegalArgumentException
- if the coordinates are out of rangeIOException
void put(int row, int column, String s) throws IOException
IllegalArgumentException
- if the coordinates are out of rangeIllegalArgumentException
- if the end of string would be outside the windowIOException
void put(int row, int column, int c) throws IOException
IllegalArgumentException
- if the coordinates are out of rangeIOException
void put(int row, int column, char c) throws IOException
IllegalArgumentException
- if the coordinates are out of rangeIOException
void put(int row, int column, byte c) throws IOException
IllegalArgumentException
- if the coordinates are out of rangeIOException
void flush() throws IOException
IOException
void move(int row, int column) throws IOException
IllegalArgumentException
- if the coordinates are out of rangeIOException
void close() throws IOException
IOException
Copyright © 2016. All rights reserved.