|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dtools.ini.IniFile
org.dtools.ini.BasicIniFile
public class BasicIniFile
A basic\simple implementation of the IniFile
interface.
This class implements only the abstract methods of
AbstractIniFile
and nothing else. Therefore, the performance of
this class is not as good as it could be. However the class stays simple and
provides a quick implementation for the IniFile
interface.
Field Summary |
---|
Fields inherited from class org.dtools.ini.IniFile |
---|
validator |
Constructor Summary | |
---|---|
BasicIniFile()
Default constructor which creates a new instance of BasicIniFile and sets the IniFile to have a
default IniValidator and to be case insensitive. |
|
BasicIniFile(boolean caseSensitive)
Default constructor which creates a new instance of BasicIniFile and sets the IniFile to have a
default IniValidator . |
|
BasicIniFile(IniValidator validator)
Default constructor which creates a new instance of BasicIniFile and sets the IniFile to have a
default IniValidator and to be case insensitive. |
|
BasicIniFile(IniValidator validator,
boolean caseSensitive)
Default constructor which creates a new instance of BasicIniFile and sets the IniFile to have a
default IniValidator and to be case insensitive. |
Method Summary | |
---|---|
boolean |
addSection(IniSection section,
int index)
Adds a section to this INI file. |
Object |
clone()
|
protected IniSection |
createSection(String name)
This method creates and returns a new instance of an IniSection with the same IniValidator and case
sensitivity as this object. |
IniSection |
getSection(int index)
Get the section which is at the given index. |
Collection<IniSection> |
getSections()
Gets a collection of all the sections within this INI file. |
int |
indexOf(IniSection section)
Get the index of the given section, where 0 is the index is the first section. |
Iterator<IniSection> |
iterator()
|
boolean |
removeSection(IniSection section)
Removes the given section only if the section is within this IniFile |
Methods inherited from class org.dtools.ini.IniFile |
---|
addOrMergeSection, addSection, addSection, addSection, addSections, equals, getNumberOfItems, getNumberOfSections, getSection, getSectionNames, getValidator, hashCode, hasSection, hasSection, indexOf, isCaseSensitive, isEmpty, merge, moveSection, moveSection, removeAll, removeSection, removeSection, removeSections, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BasicIniFile()
Default constructor which creates a new instance of
BasicIniFile
and sets the IniFile
to have a
default IniValidator
and to be case insensitive.
public BasicIniFile(boolean caseSensitive)
Default constructor which creates a new instance of
BasicIniFile
and sets the IniFile
to have a
default IniValidator
.
caseSensitive
- Sets whether this instance of IniFile
is case sensitive or not.public BasicIniFile(IniValidator validator)
Default constructor which creates a new instance of
BasicIniFile
and sets the IniFile
to have a
default IniValidator
and to be case insensitive.
validator
- Sets the IniValidator
if this instance of
IniFile
.public BasicIniFile(IniValidator validator, boolean caseSensitive)
Default constructor which creates a new instance of
BasicIniFile
and sets the IniFile
to have a
default IniValidator
and to be case insensitive.
caseSensitive
- Sets whether this instance of IniFile
is case sensitive or not.validator
- Sets the IniValidator
if this instance of
IniFile
.Method Detail |
---|
public boolean addSection(IniSection section, int index)
IniFile
Adds a section to this INI file. If an existing section has the same name as the given section, then the new section is not added and the method returns false. If the given section is of a type that is not compatible with the class that implements this interface, then a compatible copy of the section is made which is then added to the class.
addSection
in class IniFile
section
- The section to add to this INI file.index
- The index where to add the section, where 0 is the index of
the first section. Any section that already exists at this index
will be moved to index + 1
. If the value is greater
than the number of sections within this INI file, then the section
is appended to the end of the INI file.
protected IniSection createSection(String name)
IniFile
IniSection
with the same IniValidator
and case
sensitivity as this object.
createSection
in class IniFile
name
- The name of the IniSection
to create.
IniSection
with the same
IniValidator
and case sensitivity as this object.public IniSection getSection(int index)
IniFile
getSection
in class IniFile
index
- the index of the section to retrieve.
public Collection<IniSection> getSections()
IniFile
getSections
in class IniFile
public int indexOf(IniSection section)
IniFile
indexOf
in class IniFile
section
- The section whose index will be retured
public boolean removeSection(IniSection section)
IniFile
removeSection
in class IniFile
section
- The section to remove.
public Object clone()
clone
in class IniFile
public Iterator<IniSection> iterator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |