org.pricingnexus.tools
Class IniReader

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.pricingnexus.tools.IniReader
All Implemented Interfaces:
java.lang.Runnable

public class IniReader
extends java.lang.Thread


Field Summary
static int NOT_IN_LIST
          This values is returned if a value is requested but not found
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
IniReader()
           
 
Method Summary
static java.lang.String getValue(java.lang.String theKey)
          Calling this method someone can get the value(s) for a key in the INI file.
static int getValueAsInt(java.lang.String theKey)
          This method returns a value as int number.
static boolean initializationStatus()
          Method can be questioned to retreive TRUE or FALSE depending if INI file retreiving was successfull
static int ReadFile(java.lang.String iniFileName)
          Public interface to commit read of the INI file.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOT_IN_LIST

public static final int NOT_IN_LIST
This values is returned if a value is requested but not found
Constructor Detail

IniReader

public IniReader()
Method Detail

initializationStatus

public static boolean initializationStatus()
Method can be questioned to retreive TRUE or FALSE depending if INI file retreiving was successfull

ReadFile

public static int ReadFile(java.lang.String iniFileName)
Public interface to commit read of the INI file. Throws some exceptions, if read is not possible Return values: 0 if everything was allright 1 if IOException occured while opening the file occured (file probably not available) 2 if problems while reading occured 3 if any problems parsing the arguments in the files occured (whatever it is...)

getValue

public static java.lang.String getValue(java.lang.String theKey)
Calling this method someone can get the value(s) for a key in the INI file. It always returns it as a string. If no key with the requested name is available, the returned string has a null-value. Please note that this method is "synchronized" as it is not threadsafe and we have to prohibit reentrace this way.

getValueAsInt

public static int getValueAsInt(java.lang.String theKey)
This method returns a value as int number. If a conversion is not possible or the key is not found it returns -9999