public class InputDecoder extends Object
Key
objects to be put in the input queue.Constructor | Description |
---|---|
InputDecoder(Reader source) |
Creates a new input decoder using a specified Reader as the source to read characters from
|
Modifier and Type | Method | Description |
---|---|---|
void |
addProfile(KeyDecodingProfile profile) |
Adds another key decoding profile to this InputDecoder, which means all patterns from the profile will be used
when decoding input.
|
KeyStroke |
getNextCharacter(boolean blockingIO) |
Reads and decodes the next key stroke from the input stream
|
Collection<CharacterPattern> |
getPatterns() |
Returns a collection of all patterns registered in this InputDecoder.
|
int |
getTimeoutUnits() |
queries the current timeoutUnits value.
|
boolean |
removePattern(CharacterPattern pattern) |
Removes one pattern from the list of patterns in this InputDecoder
|
void |
setTimeoutUnits(int units) |
Sets the number of 1/4-second units for how long to try to get further input
to complete an escape-sequence for a special Key.
|
public InputDecoder(Reader source)
source
- Reader to read characters from, will be wrapped by a BufferedReaderpublic void addProfile(KeyDecodingProfile profile)
profile
- Profile to addpublic Collection<CharacterPattern> getPatterns()
public boolean removePattern(CharacterPattern pattern)
pattern
- Pattern to removetrue
if the supplied pattern was found and was removed, otherwise false
public void setTimeoutUnits(int units)
units
- New timeout to use, in 250ms unitspublic int getTimeoutUnits()
public KeyStroke getNextCharacter(boolean blockingIO) throws IOException
blockingIO
- If set to true
, the call will not return until it has read at least one KeyStroke
null
if noneIOException
- If there was an I/O error when reading from the input streamCopyright © 2020. All rights reserved.