| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectprojectpossibility.COptionsDb
public class COptionsDb
An adapter layer over the J2ME RecordStore that allows users to store data values as name-value pairs. The values are persisted in the phone's setting database when the application exits and can be restored the next time the application starts.
WARNING Only a single value of ANY type can be associated with a given name. Storing a value to an existing name, will overwrite that value (regardless of type).
| Constructor Summary | |
|---|---|
| COptionsDb()Construct a default options database. | |
| Method Summary | |
|---|---|
|  boolean | LoadBool(java.lang.String tag,
         boolean defaultVal)Load boolean value stored with name "tag" from the options database | 
|  double | LoadDouble(java.lang.String tag,
           double defaultVal)Load a double value stored with name "tag" from the options database | 
|  int | LoadInt(java.lang.String tag,
        int defaultVal)Load an integer value stored with name "tag" from the options database | 
|  java.lang.String | LoadString(java.lang.String tag,
           java.lang.String defaultVal)Load a string value stored with name "tag" from the options database | 
|  void | SaveBool(java.lang.String tag,
         boolean val)Store a boolean value into the options database | 
|  void | SaveDouble(java.lang.String tag,
           double val)Store a double value into the options database | 
|  void | SaveInt(java.lang.String tag,
        int val)Store an integer value into the options database | 
|  void | SaveString(java.lang.String tag,
           java.lang.String val)Store a string value into the options database | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public COptionsDb()
| Method Detail | 
|---|
public boolean LoadBool(java.lang.String tag,
                        boolean defaultVal)
tag - The "name" of the boolean value to loaddefaultVal - The default value to return for the option if it is not yet stored in the db
public double LoadDouble(java.lang.String tag,
                         double defaultVal)
tag - The name of the double value to loaddefaultVal - The default value to return if it is not available in the db
public int LoadInt(java.lang.String tag,
                   int defaultVal)
tag - The name of the integer value to loaddefaultVal - The default value to return if it is not available in the db
public java.lang.String LoadString(java.lang.String tag,
                                   java.lang.String defaultVal)
tag - The name of the string value to loaddefaultVal - The default string to return if it not available in the db
public void SaveBool(java.lang.String tag,
                     boolean val)
tag - The name of the valueval - The boolean value to store
public void SaveDouble(java.lang.String tag,
                       double val)
tag - The name of the valueval - The double value to store
public void SaveInt(java.lang.String tag,
                    int val)
tag - The name of the valueval - The integer value to store
public void SaveString(java.lang.String tag,
                       java.lang.String val)
tag - The name of the valueval - The integer value to store| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||