de.kosi.util
Class Configuration

java.lang.Object
  |
  +--de.kosi.util.Configuration

public class Configuration
extends java.lang.Object

The class Configuration provides a simple Configuration mechanism. There is only one Configuratin for the whole program (which is, why all methods are static). A Configuration contains mappings from strings to values. The values a loaded from a file. The file format is documented in java.util.PropertyResourceBundle.

ChangeLog:

 $Log: Configuration.java,v $
 Revision 1.3  2001/07/19 11:42:12  jiriki
 - Fixed Bug in TrickPane.
 - Started implementation of tournament.

 Revision 1.2  2001/06/04 14:21:10  jiriki
 Made source more comliant to coding guidelines.

 Revision 1.1.1.1  2001/04/29 18:05:19  jiriki
 Imported sources from zola.

 Revision 1.3  2001/02/19 16:56:27  wombat
 Removed some bugs in server and client configuration

 Revision 1.2  2001/01/31 11:28:12  wombat
 Updated Documentation.

 

Version:
$Revision: 1.3 $ ($Date: 2001/07/19 11:42:12 $)
Author:
Jan-Ole Janssen, Niklas Mehner, Time Sticher

Method Summary
static boolean getBoolean(java.lang.String key)
          Returns the boolean value for the given key.
static int getInt(java.lang.String key)
          Returns the int value for the given key.
static java.lang.String getString(java.lang.String key)
          Returns the string value for the given key.
static java.lang.String[] getStringArray(java.lang.String key)
           
static void init(java.lang.String name)
          Initializes the Configuration.
static void initResource(java.lang.String name)
          Initializes the Configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static void init(java.lang.String name)
                 throws java.io.IOException
Initializes the Configuration. The configuration entries are loaded from a file called name.properties. Calling this method multiple times, causes the previous configuration to be overridden.
Parameters:
name - Name of the Configuration
Throws:
java.io.IOException - if the file containing the Configuration cannot be found.

initResource

public static void initResource(java.lang.String name)
                         throws java.io.IOException
Initializes the Configuration. The configuration entries are loaded from a Resource called name.properties. Calling this method multiple times, causes the previous configuration to be overridden.
Parameters:
name - Name of the Configuration
Throws:
java.io.IOException - if the file containing the Configuration cannot be found.

getString

public static java.lang.String getString(java.lang.String key)
Returns the string value for the given key.
Parameters:
key - key to be looked up in the configuration.
Returns:
configuration value.

getStringArray

public static java.lang.String[] getStringArray(java.lang.String key)

getInt

public static int getInt(java.lang.String key)
Returns the int value for the given key.
Parameters:
key - key to be looked up in the configuration.
Returns:
configuration value.

getBoolean

public static boolean getBoolean(java.lang.String key)
Returns the boolean value for the given key.
Parameters:
key - key to be looked up in the configuration.
Returns:
configuration value.