public interface IParameters
| Modifier and Type | Method and Description |
|---|---|
void |
fromString(String data)
Parses the parameters stored into a string back into the object.
|
boolean |
getBoolean(String name)
Gets the boolean value for the given parameter name.
|
int |
getInteger(String name)
Gets the integer value for a given parameter name.
|
ParametersDescription |
getParametersDescription()
Gets the description of the parameters.
|
String |
getPath()
Gets the full path of the last file where the parameters where loaded
from or saved to.
|
String |
getString(String name)
Gets the string value for a given parameter name.
|
void |
load(InputStream inStream,
boolean ignoreErrors)
Loads the parameters from a file.
|
void |
load(URL inputURL,
boolean ignoreErrors)
Loads the parameters from a file.
|
void |
reset()
Reset the parameters to their default values.
|
void |
save(String filePath)
Saves the parameters to a file.
|
void |
setBoolean(String name,
boolean value)
Sets the boolean value for a given parameter name.
|
void |
setInteger(String name,
int value)
Sets the integer value for a given parameter name.
|
void |
setPath(String filePath)
Sets the full path of the file where the parameters are to be
saved to.
|
void |
setString(String name,
String value)
Sets the string value for a given parameter name.
|
String |
toString()
Converts the parameters into a string.
|
void reset()
String toString()
void fromString(String data)
data - the string holding the parameters. It must be formatted as
the string generated by toString(). Line-breaks must be normalized to '\n'.
It can also be null or empty, in such case the parameters are left with
their current values. Use reset() to reset the parameters to their defaults.void load(URL inputURL, boolean ignoreErrors)
inputURL - URL of the parameters file to load.ignoreErrors - true if the load should ignore any error
such as file not found. If an error occurs and this is set to true,
the method should create the parameters object with its default values.void load(InputStream inStream, boolean ignoreErrors)
inStream - input stream with the parameters to load.ignoreErrors - true if the load should ignore any error
such as file not found. If an error occurs and this is set to true,
the method should create the parameters object with its default values.void save(String filePath)
filePath - the full path of the parameters file to save.String getPath()
void setPath(String filePath)
filePath - the full path to set.boolean getBoolean(String name)
name - the name of the boolean parameter to retrieve.void setBoolean(String name, boolean value)
name - the name of the parameter to set.value - the new value to set.String getString(String name)
name - the name of the string parameter to retrieve.void setString(String name, String value)
name - the name of the parameter to set.value - the new value to set.int getInteger(String name)
name - the name of the integer parameter to retrieve.void setInteger(String name, int value)
name - the name of the parameter to set.value - the new value to set.ParametersDescription getParametersDescription()
Copyright © 2022. All rights reserved.