public class IniFile extends Object
de.uni_leipzig.asv.bordag.sgz.util.IniReader,
de.uni_leipzig.asv.bordag.sgz.util.IniWriter| Modifier and Type | Field and Description |
|---|---|
static String |
ASSIGNMENT |
static String |
COMMENT |
protected Hashtable<String,Hashtable<String,String>> |
entries
A double Hashtable containing the structure and values of the file
|
protected String |
file
The file which was used to read the information and which is then used to
write changes
|
static String |
PKEY_LEFT_BRACKET
Constants defining the format of the file
|
static String |
PKEY_RIGHT_BRACKET |
| Constructor and Description |
|---|
IniFile()
Default constructor, don't use it, as instances without a filename are
senseless
|
IniFile(File file)
Convenience constructor
|
IniFile(String fileName)
Creates an instance of the IniReader and reads the file, thus cashing the
data
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
existsKeyPair(String primKey,
String secKey)
Tests whtether this inifile contains a value with the given Keypair
|
String |
getFileName()
Returns the name of the file which is associated with this instance of
IniFile
|
Hashtable |
getPrimaryKey(String key)
Returns a Hashtable containing all the entries belonging to the given
primary key
|
Hashtable<String,Hashtable<String,String>> |
getPrimaryKeys()
Returns the whole Hashtable
|
String |
getValue(String primaryKey,
String secondaryKey)
Returns the required value of the given primary key
|
void |
setValue(String primaryKey,
String secondaryKey,
String value)
Sets or Adds a given value to a given keypair
|
void |
setValues(String primaryKey,
Hashtable<String,String> hash)
Sets the values of the entire given primary key section to the given
hashtable of values
|
String |
toString()
Prints out a representation of this class
|
public static final String PKEY_LEFT_BRACKET
public static final String PKEY_RIGHT_BRACKET
public static final String ASSIGNMENT
public static final String COMMENT
protected Hashtable<String,Hashtable<String,String>> entries
protected String file
public IniFile()
public IniFile(File file)
public IniFile(String fileName)
public Hashtable getPrimaryKey(String key)
public String getValue(String primaryKey, String secondaryKey)
public void setValues(String primaryKey, Hashtable<String,String> hash)
public void setValue(String primaryKey, String secondaryKey, String value)
public boolean existsKeyPair(String primKey, String secKey)
public Hashtable<String,Hashtable<String,String>> getPrimaryKeys()
public String getFileName()
Copyright © 2013. All rights reserved.