ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Inner Classes | Public Fields | Public Methods | Protected Methods | List of all members
InMemoryPlugin Class Reference
Inheritance diagram for InMemoryPlugin:
[legend]
Collaboration diagram for InMemoryPlugin:
[legend]

Class Description


Specialization of abstract interface class ConfigurationPlugin, which holds configuration variables in memory. Instances of this class are used to create two plug-ins within standard configurations:

This class in addition acts as the parent of class IniFile and potentially other (custom) classes. For this reason, it divides the set of variables into sections (according to the category), allows comment strings for variables and sections, and virtualizes the some key methods to allow descendants to take specific actions.

This class offers important internal fields and types for public access (bauhaus code style). However, in standard cases, only the interface methods of this class should be used.

Inner Classes

class  Entry
 
class  Section
 

Public Fields

ArrayList< Sectionsections = new ArrayList<Section>()
 
- Public Fields inherited from ConfigurationPlugin
XTernalizer stringConverter
 

Public Methods

 InMemoryPlugin ()
 
boolean load (Variable variable, boolean searchOnly)
 
void reset ()
 
Section searchOrCreateSection (CharSequence name, AString comments)
 
Section searchSection (CharSequence name)
 
boolean store (Variable variable)
 
- Public Methods inherited from ConfigurationPlugin
boolean load (Variable variable)
 
boolean store (Variable variable, Object externalizedValue)
 

Protected Methods

Section createSection (CharSequence name)
 
- Protected Methods inherited from ConfigurationPlugin
 ConfigurationPlugin ()
 

Additional Inherited Members

- Protected Fields inherited from ConfigurationPlugin
XTernalizer defaultStringConverter = new XTernalizer()
 

Constructor & Destructor Documentation

◆ InMemoryPlugin()


Constructor.

Member Function Documentation

◆ createSection()

Section createSection ( CharSequence  name)
protected

Virtual method to create a section. (Provided to allow descendant classes to created extended versions of an entry.)

Parameters
nameThe name of the section
Returns
An object of type InMemoryPlugin.Section.

Reimplemented in IniFile.

◆ load()

boolean load ( Variable  variable,
boolean  searchOnly 
)

Searches the variable in our storage.

Parameters
variableThe variable to retrieve.
searchOnlyIf true, the variable is not read. Defaults to false.
Returns
true if variable was found, false if not.

Reimplemented from ConfigurationPlugin.

◆ reset()

void reset ( )

Clears all configuration data and adds a fresh anonymous section

Reimplemented in IniFile.

◆ searchOrCreateSection()

Section searchOrCreateSection ( CharSequence  name,
AString  comments 
)

Searches the Section with the given name. If the section was not found, it is created. If the section is found and has no comments, then the provided comments are appended.

Parameters
nameThe name of the section to be retrieved.
commentsThe comment lines for the section, in the case the section is not found. If this is null, no section comments are created.
Returns
Returns the section if it was found or created. null otherwise.

◆ searchSection()

Section searchSection ( CharSequence  name)

Searches the Section with the given name.

Parameters
nameThe name of the section to be retrieved.
Returns
Returns the section if it was found, null otherwise.

◆ store()

boolean store ( Variable  variable)

Creates or replaces existing variable in our storage.

Parameters
variableThe variable to retrieve.
Returns
true if the variable was written, false if not. The latter might only happen if the variable given was illegal, e.g. empty name.

Reimplemented from ConfigurationPlugin.

Reimplemented in IniFile.

Member Data Documentation

◆ sections

ArrayList<Section> sections = new ArrayList<Section>()

The list of sections.


The documentation for this class was generated from the following file: