edu.unc.csbio.RNASim
Class Config
java.lang.Object
edu.unc.csbio.RNASim.Config
public class Config
- extends java.lang.Object
The class Config
is for reading and processing configuration
file. There are three pieces of source for configuration: default setting,
config file, and command line.
The priority of them are command line > config_file > default.
- Version:
- 0.2
- Author:
- Shunping Huang , Jack Wang
Field Summary |
static java.util.Map<java.lang.String,java.lang.String> |
configuration
A LinkHashMap that maps configuration description to configuration data. |
static java.lang.String |
filename
|
Constructor Summary |
Config(java.lang.String[] margs)
a constructor for object Config . |
Method Summary |
static java.lang.String |
get(java.lang.String key)
the method will get the configuration file/data by key |
private void |
getConfigFromArgs(java.lang.String[] args)
read command line and get the configuration data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
filename
public static final java.lang.String filename
- See Also:
- Constant Field Values
configuration
public static java.util.Map<java.lang.String,java.lang.String> configuration
- A LinkHashMap that maps configuration description to configuration data.
It is initialized with default settings. The configuration data may be
later replaced by values from configuration file or command line.
Config
public Config(java.lang.String[] margs)
- a constructor for object
Config
. It will read maps all
configuration description to configuration data. If a Config file is not
found, the program will create a Config file with default settings.
- Parameters:
margs
- the modified argument array.
getConfigFromArgs
private void getConfigFromArgs(java.lang.String[] args)
- read command line and get the configuration data.
- Parameters:
args
-
get
public static java.lang.String get(java.lang.String key)
- the method will get the configuration file/data by key
- Parameters:
key
-
- Returns:
- the configuration file/data