Utils
Class ParamsCollector

java.lang.Object
  |
  +--Utils.ParamsCollector

public final class ParamsCollector
extends java.lang.Object

Class that may be used to retrieve parameters from a file. Each line of this file must set a parameter. A line takes the form : "parameter = value // comments".

Author:
Pierre Gérard

Field Summary
static java.util.Hashtable hash
          Hastable used by the ParamsCollector
private static java.lang.String parametersFile
           
 
Constructor Summary
ParamsCollector()
           
 
Method Summary
private static void addParameter(java.lang.String line)
           
static java.lang.String convertIntoString()
          Return a string representation of all parameters and associated values
static java.util.Hashtable fillHashTable(java.lang.String fileName)
          Init method to fill the Hashtable with every file's values
static java.lang.String getValue(java.lang.String param)
           
static void main(java.lang.String[] args)
          A test routine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hash

public static java.util.Hashtable hash
Hastable used by the ParamsCollector


parametersFile

private static java.lang.String parametersFile
Constructor Detail

ParamsCollector

public ParamsCollector()
Method Detail

fillHashTable

public static java.util.Hashtable fillHashTable(java.lang.String fileName)
Init method to fill the Hashtable with every file's values


addParameter

private static void addParameter(java.lang.String line)

getValue

public static java.lang.String getValue(java.lang.String param)
Parameters:
param - The name of a parameter
Returns:
The value of the parameter (if it does not exist, null is returned)

convertIntoString

public static java.lang.String convertIntoString()
Return a string representation of all parameters and associated values


main

public static void main(java.lang.String[] args)
A test routine