shared
Class Config

java.lang.Object
  extended byshared.Config

public final class Config
extends java.lang.Object

This class makes all the configuration options available to all the other classes and objects of this program. Its reading and writing back the values from and to the config.txt file.

Author:
buetow

Field Summary
static java.lang.String VERSION
           
 
Constructor Summary
Config()
           
 
Method Summary
static boolean getBooleanValue(java.lang.String sKey)
          This method returns a specific boolean config value.
static int getIntValue(java.lang.String sKey)
          This method returns a specific integer config value.
static java.util.Set getKeySet()
          This method returns a set of keys of the config hash map.
static java.net.InetAddress getServerAddress()
          This method returns the inet address of the calendar server.
static java.lang.String[] getSortedKeyArray()
          This method returns a sorted String array of all available config keys.
static java.lang.String getStringValue(java.lang.String sKey)
          This method returns a specific string config value.
static void initialize(java.lang.String[] args)
          Initializes all the config values.
static void readConfig(java.lang.String sConfigFile)
          This methods reads the options from the calendar config file 'config.txt'.
static void setValue(java.lang.String sKey, java.lang.String sVal)
          This method changes or adds a specific config value.
static void writeConfigToFile()
          This method writes the current configuration to the config file "config.txt".
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
See Also:
Constant Field Values
Constructor Detail

Config

public Config()
Method Detail

initialize

public static void initialize(java.lang.String[] args)
Initializes all the config values.

Parameters:
args - The start parameters.

readConfig

public static void readConfig(java.lang.String sConfigFile)
This methods reads the options from the calendar config file 'config.txt'.

Parameters:
sConfigFile - Specifies the relative or absolute path to the config file.

getServerAddress

public static java.net.InetAddress getServerAddress()
This method returns the inet address of the calendar server.

Returns:
Returns the calendar server's address .

getStringValue

public static java.lang.String getStringValue(java.lang.String sKey)
This method returns a specific string config value.

Parameters:
sKey - Specifies the key of the config value to return.
Returns:
Returns the requested config value.

getIntValue

public static int getIntValue(java.lang.String sKey)
This method returns a specific integer config value.

Parameters:
sKey - Specifies the key of the config value to return.
Returns:
Returns the requested config value.

getBooleanValue

public static boolean getBooleanValue(java.lang.String sKey)
This method returns a specific boolean config value.

Parameters:
sKey - Specifies the key of the config value to return.
Returns:
Returns the requested config value.

getKeySet

public static java.util.Set getKeySet()
This method returns a set of keys of the config hash map.

Returns:
Returns a Set object containing all keys of the Config's hash map.

setValue

public static void setValue(java.lang.String sKey,
                            java.lang.String sVal)
This method changes or adds a specific config value.

Parameters:
sKey - Specifies the config key to set or update.
sVal - Specifies the value of the key to set or update.

getSortedKeyArray

public static java.lang.String[] getSortedKeyArray()
This method returns a sorted String array of all available config keys.

Returns:
Returns a sorted String array of all available config keys.

writeConfigToFile

public static void writeConfigToFile()
This method writes the current configuration to the config file "config.txt".