public class InputHelper
extends java.lang.Object
Constructor | Description |
---|---|
InputHelper() |
Creates a new InputHelper with the default storage location (determined by
the calling class's package name)
|
InputHelper(java.lang.Class c) |
Creates a new InputHelper for the specified class.
|
Modifier and Type | Method | Description |
---|---|---|
void |
clearSettings() |
Clears the settings associated with this object from storage.
|
boolean |
getBoolean(java.lang.String msg,
java.lang.String key,
boolean verify) |
|
double |
getDouble(java.lang.String msg,
java.lang.String key,
boolean verify) |
|
int |
getInput(boolean allowEnter) |
Gets a integer from user.
|
java.lang.String |
getKey(java.lang.String key) |
Gets the value for a key.
|
java.lang.String |
select(java.lang.String key,
java.lang.String[] select,
java.lang.String name,
boolean verify) |
Selects the value for a key.
|
java.lang.String |
select(java.lang.String key,
java.util.List<Factory> select,
java.lang.String name,
boolean verify) |
Selects the value for a key.
|
public InputHelper(java.lang.Class c)
c
- the class to create a InputHelper forpublic InputHelper()
public java.lang.String select(java.lang.String key, java.lang.String[] select, java.lang.String name, boolean verify)
key
- the key to select a value forselect
- the list of available valuesname
- a display name for the keyverify
- if true, and no value is found, lets user select a valuepublic java.lang.String select(java.lang.String key, java.util.List<Factory> select, java.lang.String name, boolean verify)
key
- the key to get a value forselect
- the list of available valuesname
- the display name for the keyverify
- if true, and no value is found, lets user select a valuepublic java.lang.String getKey(java.lang.String key)
key
- the key to get a value forpublic int getInput(boolean allowEnter) throws java.io.IOException
java.io.IOException
- if IO fails.public double getDouble(java.lang.String msg, java.lang.String key, boolean verify) throws java.io.IOException
java.io.IOException
public boolean getBoolean(java.lang.String msg, java.lang.String key, boolean verify) throws java.io.IOException
java.io.IOException
public void clearSettings() throws java.util.prefs.BackingStoreException
java.util.prefs.BackingStoreException
- if this operation cannot be completed
due to a failure in the backing store, or inability to communicate with it.java.lang.IllegalStateException
- if the associated node (or an ancestor) has
been removed with the removeNode() method.