org.mozdev.MacroTracker.toolkit.registry
Class MRegistry

java.lang.Object
  extended by org.mozdev.MacroTracker.toolkit.registry.MRegistry

public class MRegistry
extends java.lang.Object

This is basically a system registry clone from Windows. It holds settings for your program and they are outputted to a data file.

Every time you save a new setting, it is saved to the registry file taken in through the constructor.


Constructor Summary
MRegistry(java.io.File file)
          Creates a new registry using the file taken in through the constructor.
MRegistry(java.lang.String fileName)
           
 
Method Summary
 java.lang.Object getSetting(java.lang.String name)
          Returns a certain setting from the registry.
 void saveSetting(java.lang.String name, java.lang.Object data)
          Saves a setting to the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MRegistry

public MRegistry(java.lang.String fileName)
Parameters:
fileName - The name of the file to save with the registry settings.

MRegistry

public MRegistry(java.io.File file)
Creates a new registry using the file taken in through the constructor.

If the file exists at that spot, its settings are loaded into the registry. If it does not exist, a new one is created.

Method Detail

saveSetting

public void saveSetting(java.lang.String name,
                        java.lang.Object data)
Saves a setting to the registry.

If the setting already exists, it's overridden.

Parameters:
name - The name of the setting in the registry.
data - The information to contain in that setting.

getSetting

public java.lang.Object getSetting(java.lang.String name)
Returns a certain setting from the registry.

Parameters:
name - The name of the setting to retrieve.
Returns:
The object found in the registry.