public abstract class NonBlockingReader extends Object
| Constructor and Description |
|---|
NonBlockingReader() |
| Modifier and Type | Method and Description |
|---|---|
static Callable<String> |
getCallWTimeout(BufferedReader reader,
HasPrompt emptyPrint)
Returns a new callable for reading strings from a reader with a set timeout of 200ms.
|
static Callable<String> |
getCallWTimeout(BufferedReader reader,
int timeout,
HasPrompt emptyPrint)
Returns a new callable for reading strings from a reader with a given timeout.
|
static BufferedReader |
getNbReader(BufferedReader reader,
int tries,
int timeout,
HasPrompt emptyPrint)
Returns a new BufferedReader that uses tries and timeout for readline().
|
static BufferedReader |
getNbReader(String logID,
int tries,
int timeout,
HasPrompt emptyPrint)
Returns a new BufferedReader that uses tries and timeout for readline() for a UTF-8 StdIn.
|
public static Callable<String> getCallWTimeout(BufferedReader reader, HasPrompt emptyPrint)
reader - input stream to read fromemptyPrint - a printout to realize on an empty readline string, for prompts, set null if not requiredpublic static Callable<String> getCallWTimeout(BufferedReader reader, int timeout, HasPrompt emptyPrint)
reader - input stream to read fromtimeout - read timeout in milliseconds, very low numbers and 0 are accepted but might result in strange behavioremptyPrint - a printout to realize on an empty readline string, for prompts, set null if not requiredpublic static BufferedReader getNbReader(String logID, int tries, int timeout, HasPrompt emptyPrint)
logID - a string for logging in case StdIn cannot be opened with UTF-8 encodingtries - number of tries for read calls, use one as defaulttimeout - milliseconds for read timeoutemptyPrint - a printout to realize on an empty readline string, for prompts, set null if not requiredpublic static BufferedReader getNbReader(BufferedReader reader, int tries, int timeout, HasPrompt emptyPrint)
reader - original reader to extend, use in combination with MessageConsole.getStdIn(String) for standard intries - number of tries for read calls, use one as defaulttimeout - milliseconds for read timeoutemptyPrint - a printout to realize on an empty readline string, for prompts, set null if not requiredCopyright © 2010–2017. All rights reserved.