Reality Interface Classes

com.northgateis.util
Class IniFiles

java.lang.Object
 |
 +--com.northgateis.util.IniFiles

public class IniFiles
extends java.lang.Object
implements java.util.Enumeration

Defines an object that represents a Windows style ini file.

Provides methods to load and save the object in standard ini file format.


Constructor Summary
IniFiles(java.lang.String inifile)
          Construct a new IniFiles object referencing an actual file on disk.
 
Method Summary
 java.util.Enumerationelements()
          Create a list of all sections within the ini file
 booleangetBoolValue(java.lang.String OB, java.lang.String Begriff)
          Get boolean ini file value.
 intgetIntValue(java.lang.String OB, java.lang.String Begriff)
          Get integer ini file value.
 longgetLongValue(java.lang.String OB, java.lang.String Begriff)
          Get long ini file value.
 java.lang.StringgetValue(java.lang.String OB, java.lang.String Begriff)
          Get String ini file value.
 booleanhasMoreElements()
          Test if ini file has more elements
 booleanloadIni()
          Load an ini file from the specified file into this object using the current file spec.
 voidloadIni(java.lang.String f)
          Load an ini file from the specified file into this object.
 java.lang.ObjectnextElement()
          Get next section name from list
 intnumElements()
          Get number of sections in ini file
 voidremove(java.lang.String OB)
          Remove geiven section from ini file
 voidsaveIni()
          Save current object to default file.
 voidsaveIni(java.lang.String file)
          Save current object to given ini file.
 voidsetValue(java.lang.String OB, java.lang.String Begriff, boolean Eintrag)
          Set ini file value to a boolean.
 voidsetValue(java.lang.String OB, java.lang.String Begriff, int Eintrag)
          Set ini file value to a integer.
 voidsetValue(java.lang.String OB, java.lang.String Begriff, long Eintrag)
          Set ini file value to a long.
 voidsetValue(java.lang.String OB, java.lang.String Begriff, java.lang.String Eintrag)
          Set ini file value to a String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IniFiles

public IniFiles(java.lang.String inifile)
Construct a new IniFiles object referencing an actual file on disk.
Parameters:
iniFile - Path to ini file
Method Detail

loadIni

public void loadIni(java.lang.String f)
Load an ini file from the specified file into this object. Specified file becomes the default for this object.
Parameters:
iniFile - Path to ini file

loadIni

public boolean loadIni()
Load an ini file from the specified file into this object using the current file spec.

saveIni

public void saveIni(java.lang.String file)
Save current object to given ini file. Specified file becomes the default for this object.
Parameters:
iniFile - Path to ini file

saveIni

public void saveIni()
Save current object to default file.

setValue

public void setValue(java.lang.String OB,
 java.lang.String Begriff,
 boolean Eintrag)
Set ini file value to a boolean.
Parameters:
OB - Section name
Begriff - Value name
Eintrag - Value.

setValue

public void setValue(java.lang.String OB,
 java.lang.String Begriff,
 int Eintrag)
Set ini file value to a integer.
Parameters:
OB - Section name
Begriff - Value name
Eintrag - Value.

setValue

public void setValue(java.lang.String OB,
 java.lang.String Begriff,
 long Eintrag)
Set ini file value to a long.
Parameters:
OB - Section name
Begriff - Value name
Eintrag - Value.

setValue

public void setValue(java.lang.String OB,
 java.lang.String Begriff,
 java.lang.String Eintrag)
Set ini file value to a String.
Parameters:
OB - Section name
Begriff - Value name
Eintrag - Value.

getBoolValue

public boolean getBoolValue(java.lang.String OB,
 java.lang.String Begriff)
Get boolean ini file value.
Parameters:
OB - Section name
Begriff - Value name

getIntValue

public int getIntValue(java.lang.String OB,
 java.lang.String Begriff)
Get integer ini file value.
Parameters:
OB - Section name
Begriff - Value name

getLongValue

public long getLongValue(java.lang.String OB,
 java.lang.String Begriff)
Get long ini file value.
Parameters:
OB - Section name
Begriff - Value name

getValue

public java.lang.String getValue(java.lang.String OB,
 java.lang.String Begriff)
Get String ini file value.
Parameters:
OB - Section name
Begriff - Value name

remove

public void remove(java.lang.String OB)
Remove geiven section from ini file
Parameters:
OB - Section name

elements

public java.util.Enumeration elements()
Create a list of all sections within the ini file
Returns:
An enumeration object used to access the list of section names in the ini file.

hasMoreElements

public boolean hasMoreElements()
Test if ini file has more elements
Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
Name of next section in inifile (String)

nextElement

public java.lang.Object nextElement()
Get next section name from list
Specified by:
nextElement in interface java.util.Enumeration

numElements

public int numElements()
Get number of sections in ini file
Returns:
Number of sections in ini file

Reality Interface Classes

Copyright (c) 2000 NEC Software Services (UK) Limited