com.opera.core.systems.preferences
Interface OperaPreferences

All Superinterfaces:
Iterable<OperaPreferences.OperaPreference>
All Known Implementing Classes:
AbstractOperaPreferences, OperaFilePreferences, OperaGenericPreferences, OperaScopePreferences

public interface OperaPreferences
extends Iterable<OperaPreferences.OperaPreference>

Interface for reading and interacting with preferences in the Opera web browser.


Nested Class Summary
static interface OperaPreferences.OperaPreference
          Interface representing individual preferences.
 
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.
 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 interface java.lang.Iterable
iterator
 

Method Detail

all

Iterable<OperaPreferences.OperaPreference> all()
Returns an iterable collection of all preferences present in the current object.

Returns:
iterable list of preferences

merge

void merge(OperaPreferences newPreferences)
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.

Parameters:
newPreferences - the preferences to merge

set

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

Parameters:
preference - the preference to add or update

set

void set(String section,
         String key,
         Object value)
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 set(OperaPreference) method.

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

OperaPreferences.OperaPreference get(String section,
                                     String key)
Returns the preference with the given section and key values.

Parameters:
section - the section name, can be case-insensitive
key - the key name, can be case-insensitive
Returns:
the preference requested

size

int size()
Returns the number of preferences in the representation.

Returns:
number of preferences


Copyright © 2012. All Rights Reserved.