com.opera.core.systems.preferences
Class AbstractOperaPreferences.AbstractPreference

java.lang.Object
  extended by com.opera.core.systems.preferences.AbstractOperaPreferences.AbstractPreference
All Implemented Interfaces:
OperaPreferences.OperaPreference
Direct Known Subclasses:
OperaFilePreferences.FilePreference, OperaGenericPreferences.GenericPreference, OperaScopePreferences.ScopePreference
Enclosing class:
AbstractOperaPreferences

public abstract static class AbstractOperaPreferences.AbstractPreference
extends Object
implements OperaPreferences.OperaPreference

Shared methods for the OperaPreferences.OperaPreference interface for keeping the local cache of individual preference up to date.

See Also:
OperaScopePreferences.ScopePreference, OperaFilePreferences.FilePreference

Field Summary
protected  Object defaultValue
           
 
Constructor Summary
AbstractOperaPreferences.AbstractPreference(String section, String key, Object value)
           
 
Method Summary
 Object getDefaultValue()
          Gets the default value of the preference.
 String getKey()
          Gets the key of this preference.
 String getSection()
          Gets the section this preference belongs to.
 Object getValue()
          Gets the value of this preference.
 Object getValue(boolean operaCompatible)
          Gets the preference's value.
 void setValue(Object value)
          Sets the value of this preference.
 String toString()
          Gets the value of this preference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultValue

protected Object defaultValue
Constructor Detail

AbstractOperaPreferences.AbstractPreference

public AbstractOperaPreferences.AbstractPreference(String section,
                                                   String key,
                                                   Object value)
Method Detail

getSection

public String getSection()
Description copied from interface: OperaPreferences.OperaPreference
Gets the section this preference belongs to.

Specified by:
getSection in interface OperaPreferences.OperaPreference
Returns:
the parent section of this preference

getKey

public String getKey()
Description copied from interface: OperaPreferences.OperaPreference
Gets the key of this preference.

Specified by:
getKey in interface OperaPreferences.OperaPreference
Returns:
the key of this preference

getValue

public Object getValue()
Description copied from interface: OperaPreferences.OperaPreference
Gets the value of this preference.

Specified by:
getValue in interface OperaPreferences.OperaPreference
Returns:
the value of this preference

getValue

public Object getValue(boolean operaCompatible)
Gets the preference's value. Special cases are made for preferences of the types File and OperaColor, where strings representing their values will be returned instead of their actual object type.

Parameters:
operaCompatible - whether the returned value should be compatible for sending to Opera
Returns:
the value of this preference

setValue

public void setValue(Object value)
Description copied from interface: OperaPreferences.OperaPreference
Sets the value of this preference.

Specified by:
setValue in interface OperaPreferences.OperaPreference
Parameters:
value - the new value

getDefaultValue

public Object getDefaultValue()
Description copied from interface: OperaPreferences.OperaPreference
Gets the default value of the preference.

Specified by:
getDefaultValue in interface OperaPreferences.OperaPreference
Returns:
the default value of this preference

toString

public String toString()
Description copied from interface: OperaPreferences.OperaPreference
Gets the value of this preference.

Specified by:
toString in interface OperaPreferences.OperaPreference
Overrides:
toString in class Object
Returns:
the value of this preference


Copyright © 2012. All Rights Reserved.