com.opera.core.systems.preferences
Class AbstractOperaPreferences

java.lang.Object
  extended by com.opera.core.systems.preferences.AbstractOperaPreferences
All Implemented Interfaces:
OperaPreferences, Iterable<OperaPreferences.OperaPreference>
Direct Known Subclasses:
OperaFilePreferences, OperaGenericPreferences, OperaScopePreferences

public abstract class AbstractOperaPreferences
extends Object
implements OperaPreferences

Shared functionality between various OperaPreferences implementations.

See Also:
OperaScopePreferences, OperaFilePreferences

Nested Class Summary
static class AbstractOperaPreferences.AbstractPreference
          Shared methods for the OperaPreferences.OperaPreference interface for keeping the local cache of individual preference up to date.
 
Nested classes/interfaces inherited from interface com.opera.core.systems.preferences.OperaPreferences
OperaPreferences.OperaPreference
 
Field Summary
protected  Collection<OperaPreferences.OperaPreference> preferences
           
 
Constructor Summary
AbstractOperaPreferences()
           
 
Method Summary
 Iterable<OperaPreferences.OperaPreference> all()
          Returns an iterable collection of all preferences present in the current object.
 OperaPreferences.OperaPreference get(String section, String key)
          Returns the preference with the given section and key values.
 Iterator<OperaPreferences.OperaPreference> iterator()
           
 void merge(OperaPreferences newPreferences)
          Merges one representation with the given representation.
 void set(OperaPreferences.OperaPreference preference)
          Sets the given preference.
 void set(String section, String key, Object value)
          Sets the given preference information.
 int size()
          Returns the number of preferences in the representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

preferences

protected Collection<OperaPreferences.OperaPreference> preferences
Constructor Detail

AbstractOperaPreferences

public AbstractOperaPreferences()
Method Detail

iterator

public Iterator<OperaPreferences.OperaPreference> iterator()
Specified by:
iterator in interface Iterable<OperaPreferences.OperaPreference>

all

public Iterable<OperaPreferences.OperaPreference> all()
Description copied from interface: OperaPreferences
Returns an iterable collection of all preferences present in the current object.

Specified by:
all in interface OperaPreferences
Returns:
iterable list of preferences

set

public void set(OperaPreferences.OperaPreference preference)
Description copied from interface: OperaPreferences
Sets the given preference. If a previous preference with the same section and key names exist, it will be replaced by the given preference.

Specified by:
set in interface OperaPreferences
Parameters:
preference - the preference to add or update

set

public void set(String section,
                String key,
                Object value)
Description copied from interface: OperaPreferences
Sets the given preference information. If a previous preference with the same section and key names exist, it will be replaced by the given preference. This is a shortcut for the OperaPreferences.set(OperaPreference) method.

Specified by:
set in interface OperaPreferences
Parameters:
section - the section name, can be case-insensitive
key - the key name, can be case-insensitive
value - the new value (will be treated as a String in Opera

get

public OperaPreferences.OperaPreference get(String section,
                                            String key)
Description copied from interface: OperaPreferences
Returns the preference with the given section and key values.

Specified by:
get in interface OperaPreferences
Parameters:
section - the section name, can be case-insensitive
key - the key name, can be case-insensitive
Returns:
the preference requested

merge

public void merge(OperaPreferences newPreferences)
Description copied from interface: OperaPreferences
Merges one representation with the given representation. This will overwrite the preferences in the current object with the ones in the given object to be merged.

Specified by:
merge in interface OperaPreferences
Parameters:
newPreferences - the preferences to merge

size

public int size()
Description copied from interface: OperaPreferences
Returns the number of preferences in the representation.

Specified by:
size in interface OperaPreferences
Returns:
number of preferences


Copyright © 2012. All Rights Reserved.