megamek.common.preference
Interface IPreferenceStore

All Known Subinterfaces:
IClientPreferences
All Known Implementing Classes:
ClientPreferences, GUIPreferences, GUIPreferences, PreferenceStore, PreferenceStoreProxy

public interface IPreferenceStore


Field Summary
static boolean BOOLEAN_DEFAULT
          The predefined default value for boolean preference
static double DOUBLE_DEFAULT
          The predefined default value for double preference
static java.lang.String FALSE
          The string representation used for false
static float FLOAT_DEFAULT
          The predefined default value for float preference
static int INT_DEFAULT
          The predefined default value for int preference
static long LONG_DEFAULT
          The predefined default value for long preference
static java.lang.String STRING_DEFAULT
          The predefined default value for String preference
static java.lang.String TRUE
          The string representation used for true
 
Method Summary
 void addPreferenceChangeListener(IPreferenceChangeListener listener)
          Adds a preference change listener to this store.
 java.lang.String[] getAdvancedProperties()
           
 boolean getBoolean(java.lang.String name)
          Returns the value of the boolean preference with the given name.
 boolean getDefaultBoolean(java.lang.String name)
          Returns the default value for the boolean preference with the given name.
 double getDefaultDouble(java.lang.String name)
          Returns the default value for the double preference with the given name.
 float getDefaultFloat(java.lang.String name)
          Returns the default value for the float preference with the given name.
 int getDefaultInt(java.lang.String name)
          Returns the default value for the int preference with the given name.
 long getDefaultLong(java.lang.String name)
          Returns the default value for the long preference with the given name.
 java.lang.String getDefaultString(java.lang.String name)
          Returns the default value for the String preference with the given name.
 double getDouble(java.lang.String name)
          Returns the value of the double preference with the given name.
 float getFloat(java.lang.String name)
          Returns the value of the float preference with the given name.
 int getInt(java.lang.String name)
          Returns the value of the int preference with the given name.
 long getLong(java.lang.String name)
          Returns the value of the long preference with the given name.
 java.lang.String getString(java.lang.String name)
          Returns the value of the String preference with the given name.
 void putValue(java.lang.String name, java.lang.String value)
          Just sets the current value of the preference with the given name.
 void removePreferenceChangeListener(IPreferenceChangeListener listener)
          Removes the given listener from this store.
 void setDefault(java.lang.String name, boolean value)
          Sets the default value for the boolean preference with the given name.
 void setDefault(java.lang.String name, double value)
          Sets the default value for the double preference with the given name.
 void setDefault(java.lang.String name, float value)
          Sets the default value for the float preference with the given name.
 void setDefault(java.lang.String name, int value)
          Sets the default value for the int preference with the given name.
 void setDefault(java.lang.String name, long value)
          Sets the default value for the long preference with the given name.
 void setDefault(java.lang.String name, java.lang.String value)
          Sets the default value for the string preference with the given name.
 void setValue(java.lang.String name, boolean value)
          Sets the current value of the boolean preference with the given name.
 void setValue(java.lang.String name, double value)
          Sets the current value of the double preference with the given name.
 void setValue(java.lang.String name, float value)
          Sets the current value of the float preference with the given name.
 void setValue(java.lang.String name, int value)
          Sets the current value of the int preference with the given name.
 void setValue(java.lang.String name, long value)
          Sets the current value of the long preference with the given name.
 void setValue(java.lang.String name, java.lang.String value)
          Sets the current value of the String preference with the given name.
 

Field Detail

BOOLEAN_DEFAULT

static final boolean BOOLEAN_DEFAULT
The predefined default value for boolean preference

See Also:
Constant Field Values

INT_DEFAULT

static final int INT_DEFAULT
The predefined default value for int preference

See Also:
Constant Field Values

LONG_DEFAULT

static final long LONG_DEFAULT
The predefined default value for long preference

See Also:
Constant Field Values

STRING_DEFAULT

static final java.lang.String STRING_DEFAULT
The predefined default value for String preference

See Also:
Constant Field Values

FLOAT_DEFAULT

static final float FLOAT_DEFAULT
The predefined default value for float preference

See Also:
Constant Field Values

DOUBLE_DEFAULT

static final double DOUBLE_DEFAULT
The predefined default value for double preference

See Also:
Constant Field Values

TRUE

static final java.lang.String TRUE
The string representation used for true

See Also:
Constant Field Values

FALSE

static final java.lang.String FALSE
The string representation used for false

See Also:
Constant Field Values
Method Detail

getDefaultBoolean

boolean getDefaultBoolean(java.lang.String name)
Returns the default value for the boolean preference with the given name.


getDefaultInt

int getDefaultInt(java.lang.String name)
Returns the default value for the int preference with the given name.


getDefaultLong

long getDefaultLong(java.lang.String name)
Returns the default value for the long preference with the given name.


getDefaultString

java.lang.String getDefaultString(java.lang.String name)
Returns the default value for the String preference with the given name.


getDefaultDouble

double getDefaultDouble(java.lang.String name)
Returns the default value for the double preference with the given name.


getDefaultFloat

float getDefaultFloat(java.lang.String name)
Returns the default value for the float preference with the given name.


setDefault

void setDefault(java.lang.String name,
                boolean value)
Sets the default value for the boolean preference with the given name.


setDefault

void setDefault(java.lang.String name,
                int value)
Sets the default value for the int preference with the given name.


setDefault

void setDefault(java.lang.String name,
                long value)
Sets the default value for the long preference with the given name.


setDefault

void setDefault(java.lang.String name,
                java.lang.String value)
Sets the default value for the string preference with the given name.


setDefault

void setDefault(java.lang.String name,
                float value)
Sets the default value for the float preference with the given name.


setDefault

void setDefault(java.lang.String name,
                double value)
Sets the default value for the double preference with the given name.


getBoolean

boolean getBoolean(java.lang.String name)
Returns the value of the boolean preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a boolean.


getInt

int getInt(java.lang.String name)
Returns the value of the int preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a int.


getLong

long getLong(java.lang.String name)
Returns the value of the long preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a long.


getString

java.lang.String getString(java.lang.String name)
Returns the value of the String preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a String.


getFloat

float getFloat(java.lang.String name)
Returns the value of the float preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a float.


getDouble

double getDouble(java.lang.String name)
Returns the value of the double preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a double.


setValue

void setValue(java.lang.String name,
              boolean value)
Sets the current value of the boolean preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.


setValue

void setValue(java.lang.String name,
              int value)
Sets the current value of the int preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.


setValue

void setValue(java.lang.String name,
              long value)
Sets the current value of the long preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.


setValue

void setValue(java.lang.String name,
              java.lang.String value)
Sets the current value of the String preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.


setValue

void setValue(java.lang.String name,
              float value)
Sets the current value of the float preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.


setValue

void setValue(java.lang.String name,
              double value)
Sets the current value of the double preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.


addPreferenceChangeListener

void addPreferenceChangeListener(IPreferenceChangeListener listener)
Adds a preference change listener to this store.

Parameters:
listener - a preference change listener

removePreferenceChangeListener

void removePreferenceChangeListener(IPreferenceChangeListener listener)
Removes the given listener from this store.


putValue

void putValue(java.lang.String name,
              java.lang.String value)
Just sets the current value of the preference with the given name. does not fire preference change event


getAdvancedProperties

java.lang.String[] getAdvancedProperties()