Session.TickingCallback
public abstract static class Session.InputCallback
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static class |
Session.InputCallback.Type |
The three different types of user input processing
supported by the abstract InputCallback class
|
Modifier and Type | Field | Description |
---|---|---|
protected boolean |
confirmed |
|
protected java.lang.String |
input |
|
protected boolean |
noTrim |
|
protected long |
timeout |
|
protected long |
timeoutMs |
|
protected boolean |
waiting |
Constructor | Description |
---|---|
InputCallback(Session.InputCallback.Type type) |
Constructor.
|
InputCallback(Session.InputCallback.Type type,
long timeoutMs) |
Constructor.
|
InputCallback(Session.InputCallback.Type type,
java.lang.String defaultInput) |
Constructor.
|
InputCallback(Session.InputCallback.Type type,
java.lang.String defaultInput,
long timeoutMs) |
Constructor.
|
InputCallback(Session.InputCallback.Type type,
java.lang.String defaultInput,
java.lang.String choicesStr,
long timeoutMs) |
Full constructor.
|
Modifier and Type | Method | Description |
---|---|---|
abstract void |
callBack() |
This method is called if the user hits ENTER, and
their input data is valid (one of the choices for
CHOOSE or CONFIRM), or anything else for PROMPT.
|
boolean |
isTimedOut() |
Returns true if a timeout was given, and this class has been
active longer than that amount of time.
|
Session.InputCallback |
reset() |
This method allows reuse of a given InputCallback.
|
void |
setInput(java.lang.String input) |
Forces user-input into this class, potentially changing its user
input waiting state.
|
abstract void |
showPrompt() |
This method is called by InputCallback before user
input is requested.
|
abstract void |
timedOut() |
This method is call by InputCallback if a timeout
value greater than 0 is given and that amount of time has
been exceeded.
|
boolean |
waitForInput() |
Returns true if this class is currently waiting
for user input.
|
protected final long timeoutMs
protected volatile long timeout
protected volatile java.lang.String input
protected volatile boolean confirmed
protected volatile boolean waiting
protected volatile boolean noTrim
public InputCallback(Session.InputCallback.Type type, java.lang.String defaultInput, java.lang.String choicesStr, long timeoutMs)
type
- the type of processingdefaultInput
- default input valuechoicesStr
- list of one-character options (if CHOOSE Type)timeoutMs
- time, in ms, before the user is kickedpublic InputCallback(Session.InputCallback.Type type, java.lang.String defaultInput, long timeoutMs)
type
- the type of processingdefaultInput
- default input valuetimeoutMs
- time, in ms, before the user is kickedpublic InputCallback(Session.InputCallback.Type type, long timeoutMs)
type
- the type of processingtimeoutMs
- time, in ms, before the user is kickedpublic InputCallback(Session.InputCallback.Type type)
type
- the type of processingpublic InputCallback(Session.InputCallback.Type type, java.lang.String defaultInput)
type
- the type of processingdefaultInput
- default input valuepublic boolean isTimedOut()
public void setInput(java.lang.String input)
input
- the user input to forcepublic boolean waitForInput()
public Session.InputCallback reset()
public abstract void showPrompt()
public abstract void timedOut()
public abstract void callBack()