storage.mechanism.PrefixedMechanism Extends goog.storage.mechanism.IterableMechanism
Wraps an iterable storage mechanism and creates artificial namespaces.

Inheritance

Constructor

goog.storage.mechanism.PrefixedMechanism(mechanismprefix)

Parameters

mechanism : !goog.storage.mechanism.IterableMechanism
Underlying iterable storage mechanism.
prefix : string
Prefix for creating an artificial namespace.

Instance Methods

Public Protected Private
__iterator__()
No description.
code »
get()
No description.
code »
remove()
No description.
code »
set()
No description.
code »
__iterator__(opt_keys) !goog.iter.Iterator
Returns an iterator that iterates over the elements in the storage. Will throw goog.iter.StopIteration after the last element.
Arguments:
opt_keys : boolean=
True to iterate over the keys. False to iterate over the values. The default value is false.
Returns: !goog.iter.Iterator  The iterator.
code »
clear()
Remove all key-value pairs. Could be overridden in a subclass, as the default implementation is not very efficient - it iterates over all keys.
code »
getCount() number
Get the number of stored key-value pairs. Could be overridden in a subclass, as the default implementation is not very efficient - it iterates over all keys.
Returns: number  Number of stored elements.
code »
get(key) ?string
Get the value stored under a key.
Arguments:
key : string
The key to get.
Returns: ?string  The corresponding value, null if not found.
code »
remove(key)
Remove a key and its value.
Arguments:
key : string
The key to remove.
code »
set(keyvalue)
Set a value for a key.
Arguments:
key : string
The key to set.
value : string
The string to save.
code »

Instance Properties

constructor :
No description.
Code »
The mechanism to be prefixed.
Code »
prefix_ :
The prefix for creating artificial namespaces.
Code »
constructor :
No description.
Code »

Static Properties

goog.storage.mechanism.PrefixedMechanism.superClass_ :
No description.
Code »

Package storage.mechanism

Package Reference