misc.rr.diabetes.be.calculator.utils
Class Settings

java.lang.Object
  extended by misc.rr.diabetes.be.calculator.utils.Settings
All Implemented Interfaces:
DiabetesInterface

public class Settings
extends Object
implements DiabetesInterface

Represent and handle the settings.

Author:
Reinhold Rumberger

Field Summary
 
Fields inherited from interface misc.rr.diabetes.DiabetesInterface
stable, UNSTABLE_WARNING
 
Method Summary
 float getBef()
           
 int getEssokorr()
           
static Settings getInstance()
           
 int getKr()
           
 String getLang()
           
 String getName()
           
 float getZw()
           
 void loadSettings(String file)
          Load the settings from file.
 void saveDefaultSettings()
          Save the current settings as default settings.
 void setBef(float bef)
          Set the current BE factor.
 void setEssokorr(int essokorr)
          Set the current state of essen.
 void setKr(int kr)
          Set the current .
 void setLang(String lang)
          Set the current language (name of locale).
 void setName(String name)
           
 void setSettings(String lang, float zw, float bef, int kr, int essokorr)
          Set all the settings in one go.
 void setZw(float zw)
          Set the target value.
 void writeSettings(String filename)
          Write the Settings to filename.
 void writeSettings(String filename, boolean force)
          Write the Settings to filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Settings getInstance()

getBef

public float getBef()
Returns:
Returns the BE factor

getEssokorr

public int getEssokorr()
Returns:
Returns the index to be used in the JComboBox essen.

getKr

public int getKr()
Returns:
Returns the .

getLang

public String getLang()
Returns:
Returns the language (locale) to use.

getZw

public float getZw()
Returns:
Returns the target value.

loadSettings

public void loadSettings(String file)
Load the settings from file.

Parameters:
file -

saveDefaultSettings

public void saveDefaultSettings()
Save the current settings as default settings.


setBef

public void setBef(float bef)
Set the current BE factor.

Parameters:
bef -

setEssokorr

public void setEssokorr(int essokorr)
Set the current state of essen.

Parameters:
essokorr -

setKr

public void setKr(int kr)
Set the current .

Parameters:
kr -

setLang

public void setLang(String lang)
Set the current language (name of locale).

Parameters:
lang -

setSettings

public void setSettings(String lang,
                        float zw,
                        float bef,
                        int kr,
                        int essokorr)
Set all the settings in one go.

Parameters:
lang - -- The language (name of locale).
zw - -- The target value.
bef - -- The BE factor.
kr - -- The .
essokorr - -- The state pd essen.

setZw

public void setZw(float zw)
Set the target value.

Parameters:
zw -

writeSettings

public void writeSettings(String filename)
Write the Settings to filename.

Parameters:
filename -

writeSettings

public void writeSettings(String filename,
                          boolean force)
Write the Settings to filename.

Parameters:
filename -
force - -- If force is true, write even if filename exists.

getName

public String getName()
Returns:
Returns the name.

setName

public void setName(String name)
Parameters:
name - The name to set.