public class InputDecoder extends Object
Key
objects to be put in the input queue.Constructor and Description |
---|
InputDecoder(Reader source)
Creates a new input decoder using a specified Reader as the source to read characters from
|
Modifier and Type | Method and 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)
public int getTimeoutUnits()
public KeyStroke getNextCharacter(boolean blockingIO) throws IOException
null
if noneIOException
- If there was an I/O error when reading from the input streamCopyright © 2016. All rights reserved.