uk.ac.lancs.relate.gateways.services.config
Class Configuration

java.lang.Object
  extended by uk.ac.lancs.relate.gateways.services.config.Configuration
All Implemented Interfaces:
java.io.Serializable

public class Configuration
extends java.lang.Object
implements java.io.Serializable

Configuration which is read out of a text file. Each line of the file starts with a key (corresponds to the variable's name) followed by the value.

Author:
Sara Streng and Dominique Guinard
Personal Homepage
See Also:
Serialized Form

Constructor Summary
Configuration(java.lang.String fileName)
          Creates a new configuration which is read of a file with a given name.
 
Method Summary
 int getInt(java.lang.String key)
          Returns the value of a property with a given key as an integer.
 java.lang.String getString(java.lang.String key)
          Returns the value of a property with a given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration(java.lang.String fileName)
Creates a new configuration which is read of a file with a given name.

Parameters:
fileName - name of the configuration file
Method Detail

getString

public java.lang.String getString(java.lang.String key)
Returns the value of a property with a given key.

Parameters:
key - variable's name
Returns:
value

getInt

public int getInt(java.lang.String key)
Returns the value of a property with a given key as an integer. If the value can not be parsed -1 is returned.

Parameters:
key - variable's name
Returns:
value