|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectslib.utils.i.Conf
public class Conf
Generic Configuration class used to build object storing a configuration as
key value pairs. Conf
objects are defined by a map storing pair of
keys and values in which the key is a String
corresponding to the
flag of the parameter and the value is an Object
corresponding to the
value associated to the related key.
Constructor Summary | |
---|---|
Conf()
|
Method Summary | |
---|---|
Conf |
addParam(String p,
Object v)
Add the parameter to the configuration Override existing parameter if one exists. |
boolean |
containsParam(String p)
Return true if the given parameter is stored in the current configuration. |
boolean |
containsParams()
Check if the configuration contains at least one parameter. |
Object |
getParam(String p)
Return the value associated to the given parameter as an Object . |
double |
getParamAsDouble(String p)
Return the value associated to the given parameter as a double value. |
String |
getParamAsString(String p)
Return the value associated to the given parameter as a String . |
Map<String,Object> |
getParams()
Getter of the Map storing the entry loaded in the configuration. |
void |
removeParam(String p)
Remove the entry corresponding to the given key if one is stored. |
void |
setParams(HashMap<String,Object> params)
Set the current map to the given. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Conf()
Method Detail |
---|
public String getParamAsString(String p)
String
.
p
- the flag of the parameter you want to retrieve the value.
public Object getParam(String p)
Object
.
p
- the flag of the parameter you want to retrieve the value.
public double getParamAsDouble(String p) throws SLIB_Ex_Critic
p
- the flag of the parameter
SLIB_Ex_Critic
public boolean containsParam(String p)
p
- the parameter flag
public Conf addParam(String p, Object v)
p
- the parameter flagv
- the value associated
public void removeParam(String p)
p
- the key to process.public Map<String,Object> getParams()
public void setParams(HashMap<String,Object> params)
params
- the new map defining the configuration.public boolean containsParams()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |