public class ConfigReader extends Object
The file has to contain lines likefield=value
If a line starts with // or # it is ignored.
| Constructor and Description |
|---|
ConfigReader(String fn)
Reads the given file and stores the data.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getAsDouble(String key)
Gets the value of the line
key=value as double |
int |
getAsInt(String key)
Gets the value of the line
key=value as int |
String |
getAsString(String key)
Gets the value of the line
key=value as string |
String[] |
getAsStringArr(String key)
Gets the value of the line
key=value as string array (the value is simply splitted
by ,) |
public ConfigReader(String fn) throws IOException
fn - config fileIOExceptionpublic String getAsString(String key)
key=value as stringkey - name of the fieldpublic String[] getAsStringArr(String key)
key=value as string array (the value is simply splitted
by ,)key - name of the fieldpublic double getAsDouble(String key)
key=value as doublekey - name of the fieldpublic int getAsInt(String key)
key=value as intkey - name of the fieldCopyright © 2007–2021. All rights reserved.