de.cau.cs.kieler.core
Interface IKielerPreferenceStore

All Known Implementing Classes:
KielerPreferenceStore, MapPreferenceStore

public interface IKielerPreferenceStore

Interface for mappings of named preferences to values. Most of this interface was copied from IPreferenceStore.

Inside Eclipse KielerPreferenceStore is used as implementation, which is a wrapper for IPreferenceStore. In other environments a new implementation must be provided, for which MapPreferenceStore can serve as superclass.

Names of preference entries are usually available as constants in the respective plug-ins.

A preference store may be linked to the UI so the user is able to change preference values.

Rating proposed yellow
(2009-12-11) msp

Method Summary
 boolean contains(String name)
          Returns whether the named preference is known to this preference store.
 boolean getBoolean(String name)
          Returns the current value of the boolean-valued preference with the given name.
 boolean getDefaultBoolean(String name)
          Returns the default value for the boolean-valued preference with the given name.
 double getDefaultDouble(String name)
          Returns the default value for the double-valued preference with the given name.
 float getDefaultFloat(String name)
          Returns the default value for the float-valued preference with the given name.
 int getDefaultInt(String name)
          Returns the default value for the integer-valued preference with the given name.
 long getDefaultLong(String name)
          Returns the default value for the long-valued preference with the given name.
 String getDefaultString(String name)
          Returns the default value for the string-valued preference with the given name.
 double getDouble(String name)
          Returns the current value of the double-valued preference with the given name.
 float getFloat(String name)
          Returns the current value of the float-valued preference with the given name.
 int getInt(String name)
          Returns the current value of the integer-valued preference with the given name.
 long getLong(String name)
          Returns the current value of the long-valued preference with the given name.
 String getString(String name)
          Returns the current value of the string-valued preference with the given name.
 boolean isDefault(String name)
          Returns whether the current value of the preference with the given name has the default value.
 void setDefault(String name, boolean value)
          Sets the default value for the boolean-valued preference with the given name.
 void setDefault(String name, double value)
          Sets the default value for the double-valued preference with the given name.
 void setDefault(String name, float value)
          Sets the default value for the float-valued preference with the given name.
 void setDefault(String name, int value)
          Sets the default value for the integer-valued preference with the given name.
 void setDefault(String name, long value)
          Sets the default value for the long-valued preference with the given name.
 void setDefault(String name, String defaultObject)
          Sets the default value for the string-valued preference with the given name.
 void setToDefault(String name)
          Sets the current value of the preference with the given name back to its default value.
 void setValue(String name, boolean value)
          Sets the current value of the boolean-valued preference with the given name.
 void setValue(String name, double value)
          Sets the current value of the double-valued preference with the given name.
 void setValue(String name, float value)
          Sets the current value of the float-valued preference with the given name.
 void setValue(String name, int value)
          Sets the current value of the integer-valued preference with the given name.
 void setValue(String name, long value)
          Sets the current value of the long-valued preference with the given name.
 void setValue(String name, String value)
          Sets the current value of the string-valued preference with the given name.
 

Method Detail

contains

boolean contains(String name)
Returns whether the named preference is known to this preference store.

Parameters:
name - the name of the preference
Returns:
true if either a current value or a default value is known for the named preference, and false otherwise

getBoolean

boolean getBoolean(String name)
Returns the current value of the boolean-valued preference with the given name. Returns the default-default value (false) if there is no preference with the given name, or if the current value cannot be treated as a boolean.

Parameters:
name - the name of the preference
Returns:
the boolean-valued preference

getDefaultBoolean

boolean getDefaultBoolean(String name)
Returns the default value for the boolean-valued preference with the given name. Returns the default-default value (false) if there is no default preference with the given name, or if the default value cannot be treated as a boolean.

Parameters:
name - the name of the preference
Returns:
the default value of the named preference

getDefaultDouble

double getDefaultDouble(String name)
Returns the default value for the double-valued preference with the given name. Returns the default-default value (0.0) if there is no default preference with the given name, or if the default value cannot be treated as a double.

Parameters:
name - the name of the preference
Returns:
the default value of the named preference

getDefaultFloat

float getDefaultFloat(String name)
Returns the default value for the float-valued preference with the given name. Returns the default-default value (0.0f) if there is no default preference with the given name, or if the default value cannot be treated as a float.

Parameters:
name - the name of the preference
Returns:
the default value of the named preference

getDefaultInt

int getDefaultInt(String name)
Returns the default value for the integer-valued preference with the given name. Returns the default-default value (0) if there is no default preference with the given name, or if the default value cannot be treated as an integer.

Parameters:
name - the name of the preference
Returns:
the default value of the named preference

getDefaultLong

long getDefaultLong(String name)
Returns the default value for the long-valued preference with the given name. Returns the default-default value (0L) if there is no default preference with the given name, or if the default value cannot be treated as a long.

Parameters:
name - the name of the preference
Returns:
the default value of the named preference

getDefaultString

String getDefaultString(String name)
Returns the default value for the string-valued preference with the given name. Returns the default-default value (the empty string "") if there is no default preference with the given name, or if the default value cannot be treated as a string.

Parameters:
name - the name of the preference
Returns:
the default value of the named preference

getDouble

double getDouble(String name)
Returns the current value of the double-valued preference with the given name. Returns the default-default value (0.0) if there is no preference with the given name, or if the current value cannot be treated as a double.

Parameters:
name - the name of the preference
Returns:
the double-valued preference

getFloat

float getFloat(String name)
Returns the current value of the float-valued preference with the given name. Returns the default-default value (0.0f) if there is no preference with the given name, or if the current value cannot be treated as a float.

Parameters:
name - the name of the preference
Returns:
the float-valued preference

getInt

int getInt(String name)
Returns the current value of the integer-valued preference with the given name. Returns the default-default value (0) if there is no preference with the given name, or if the current value cannot be treated as an integter.

Parameters:
name - the name of the preference
Returns:
the int-valued preference

getLong

long getLong(String name)
Returns the current value of the long-valued preference with the given name. Returns the default-default value (0L) if there is no preference with the given name, or if the current value cannot be treated as a long.

Parameters:
name - the name of the preference
Returns:
the long-valued preference

getString

String getString(String name)
Returns the current value of the string-valued preference with the given name. Returns the default-default value (the empty string "") if there is no preference with the given name, or if the current value cannot be treated as a string.

Parameters:
name - the name of the preference
Returns:
the string-valued preference

isDefault

boolean isDefault(String name)
Returns whether the current value of the preference with the given name has the default value.

Parameters:
name - the name of the preference
Returns:
true if the preference has a known default value and its current value is the same, and false otherwise (including the case where the preference is unknown to this store)

setDefault

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

Note that the current value of the preference is affected if the preference's current value was its old default value, in which case it changes to the new default value. If the preference's current is different from its old default value, its current value is unaffected.

Parameters:
name - the name of the preference
value - the new default value for the preference

setDefault

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

Note that the current value of the preference is affected if the preference's current value was its old default value, in which case it changes to the new default value. If the preference's current is different from its old default value, its current value is unaffected.

Parameters:
name - the name of the preference
value - the new default value for the preference

setDefault

void setDefault(String name,
                int value)
Sets the default value for the integer-valued preference with the given name.

Note that the current value of the preference is affected if the preference's current value was its old default value, in which case it changes to the new default value. If the preference's current is different from its old default value, its current value is unaffected.

Parameters:
name - the name of the preference
value - the new default value for the preference

setDefault

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

Note that the current value of the preference is affected if the preference's current value was its old default value, in which case it changes to the new default value. If the preference's current is different from its old default value, its current value is unaffected.

Parameters:
name - the name of the preference
value - the new default value for the preference

setDefault

void setDefault(String name,
                String defaultObject)
Sets the default value for the string-valued preference with the given name.

Note that the current value of the preference is affected if the preference's current value was its old default value, in which case it changes to the new default value. If the preference's current is different from its old default value, its current value is unaffected.

Parameters:
name - the name of the preference
defaultObject - the new default value for the preference

setDefault

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

Note that the current value of the preference is affected if the preference's current value was its old default value, in which case it changes to the new default value. If the preference's current is different from its old default value, its current value is unaffected.

Parameters:
name - the name of the preference
value - the new default value for the preference

setToDefault

void setToDefault(String name)
Sets the current value of the preference with the given name back to its default value.

Note that the preferred way of re-initializing a preference to the appropriate default value is to call setToDefault. This is implemented by removing the named value from the store, thereby exposing the default value.

Parameters:
name - the name of the preference

setValue

void setValue(String name,
              double value)
Sets the current value of the double-valued preference with the given name.

Note that the preferred way of re-initializing a preference to its default value is to call setToDefault.

Parameters:
name - the name of the preference
value - the new current value of the preference

setValue

void setValue(String name,
              float value)
Sets the current value of the float-valued preference with the given name.

Note that the preferred way of re-initializing a preference to its default value is to call setToDefault.

Parameters:
name - the name of the preference
value - the new current value of the preference

setValue

void setValue(String name,
              int value)
Sets the current value of the integer-valued preference with the given name.

Note that the preferred way of re-initializing a preference to its default value is to call setToDefault.

Parameters:
name - the name of the preference
value - the new current value of the preference

setValue

void setValue(String name,
              long value)
Sets the current value of the long-valued preference with the given name.

Note that the preferred way of re-initializing a preference to its default value is to call setToDefault.

Parameters:
name - the name of the preference
value - the new current value of the preference

setValue

void setValue(String name,
              String value)
Sets the current value of the string-valued preference with the given name.

Note that the preferred way of re-initializing a preference to its default value is to call setToDefault.

Parameters:
name - the name of the preference
value - the new current value of the preference

setValue

void setValue(String name,
              boolean value)
Sets the current value of the boolean-valued preference with the given name.

Note that the preferred way of re-initializing a preference to its default value is to call setToDefault.

Parameters:
name - the name of the preference
value - the new current value of the preference