|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.utils.IniFile
public class IniFile
Nested Class Summary | |
---|---|
static class |
IniFile.Section
Class representing one section of the ini file. |
Constructor Summary | |
---|---|
IniFile()
Constructs Ini file with no defaults. |
|
IniFile(java.io.File source)
Constructs GameBots2004Ini with defaults taken 'source' (file must exists!). |
|
IniFile(IniFile ini)
|
Method Summary | |
---|---|
IniFile |
addIniFile(IniFile iniFile)
Add all sections from one ini file into this one. |
IniFile.Section |
addSection(IniFile.Section section)
Adds section into this ini file. |
IniFile.Section |
addSection(java.lang.String sectionName)
Adds a new section into this class (won't overwrite existing one). |
IniFile.Section |
copySection(IniFile.Section section)
|
java.lang.String |
get(java.lang.String section,
java.lang.String key)
|
IniFile.Section |
getSection(java.lang.String name)
|
java.util.Set<java.lang.String> |
getSectionNames()
|
java.util.Collection<IniFile.Section> |
getSections()
|
boolean |
hasSection(java.lang.String name)
|
void |
load(java.io.File source)
Loads IniFile#source into sections . |
java.lang.String |
output()
Returns contents of this IniFile as string. |
void |
output(java.io.File file)
Outputs GameBots2004.ini stored by this class into 'file'. |
void |
output(java.io.PrintWriter writer)
Outputs contents of this IniFile into the 'writer'. |
void |
output(java.lang.String pathToFileToBeCreated)
Outputs GameBots2004.ini stored by this class into 'file'. |
IniFile.Section |
set(java.lang.String section,
java.lang.String key,
java.lang.String value)
Sets property key=value into section 'section' |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IniFile()
public IniFile(java.io.File source)
source
- public IniFile(IniFile ini)
Method Detail |
---|
public void load(java.io.File source)
IniFile#source
into sections
.
Note that his method won't clear anything, it will just load all sections/properties from the given file possibly overwriting existing properties in existing sections.
source
- public IniFile addIniFile(IniFile iniFile)
iniFile
-
public IniFile.Section addSection(java.lang.String sectionName)
sectionName
-
public IniFile.Section addSection(IniFile.Section section)
If 'section' is a new section (i.e., its IniFile.Section.getName()
is not already present in stored sections), this instance
will be stored here (does not hard-copy the section!). For hard-copy variant, use copySection(Section)
.
section
-
public IniFile.Section copySection(IniFile.Section section)
public boolean hasSection(java.lang.String name)
public IniFile.Section getSection(java.lang.String name)
public java.util.Set<java.lang.String> getSectionNames()
public java.util.Collection<IniFile.Section> getSections()
public java.lang.String get(java.lang.String section, java.lang.String key)
public IniFile.Section set(java.lang.String section, java.lang.String key, java.lang.String value)
section
- key
- value
-
public void output(java.lang.String pathToFileToBeCreated)
file
- public void output(java.io.File file)
file
- public void output(java.io.PrintWriter writer)
IniFile
into the 'writer'.
writer
- public java.lang.String output()
IniFile
as string.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |