public abstract class Configuration
extends java.lang.Object
processCommandLineArguments(String[])
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION |
Constructor and Description |
---|
Configuration()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
dumpToFilesystem()
Builds the content of a config file for the current configuration.
|
java.lang.Float |
getFloat(java.lang.String key)
Get a floating point parameter.
|
static Configuration |
getGlobalConfiguration()
Get configuration singleton.
|
java.lang.Integer |
getInteger(java.lang.String key)
Get a integer parameter.
|
java.lang.String |
getString(java.lang.String key)
Get a string parameter.
|
boolean |
loadConfigurationFile(java.lang.String fileName)
Load parameters from a configuration file.
|
void |
printHelp()
Prints a help text to stdout.
|
void |
processCommandLineArguments(java.lang.String[] args)
Parse the command line arguments and overrides parameters if they
appear in them.
|
void |
restore()
Restores the default configuration.
|
void |
set(java.lang.String key,
float value)
Set the value of a parameter.
|
void |
set(java.lang.String key,
int value)
Set the value of a parameter.
|
void |
set(java.lang.String key,
java.lang.String value)
Set the value of a parameter.
|
public static final java.lang.String VERSION
public Configuration()
restore()
public void restore()
public static Configuration getGlobalConfiguration()
public void set(java.lang.String key, int value)
key
- value
- public void set(java.lang.String key, float value)
key
- value
- public java.lang.Integer getInteger(java.lang.String key)
key
- the name of the parameterpublic java.lang.Float getFloat(java.lang.String key)
key
- the name of the parameterpublic java.lang.String getString(java.lang.String key)
key
- the name of the parameterpublic void set(java.lang.String key, java.lang.String value)
key
- value
- public void processCommandLineArguments(java.lang.String[] args)
argv
- string array with command line argumentspublic boolean loadConfigurationFile(java.lang.String fileName)
fileName
- path to the file to loadboolean
- TRUE if the file could be loaded, FALSE otherwisepublic void printHelp()
public void dumpToFilesystem()