storage.mechanism.HTML5LocalStorage Extends goog.storage.mechanism.HTML5WebStorage
Provides a storage mechanism that uses HTML5 local storage.

Inheritance

Constructor

goog.storage.mechanism.HTML5LocalStorage()

Instance Methods

Public Protected Private
__iterator__()
No description.
code »
clear()
No description.
code »
get()
No description.
code »
getCount()
No description.
code »
isAvailable() boolean
Determines whether or not the mechanism is available. It works only if the provided web storage object exists and is enabled.
Returns: boolean  True if the mechanism is available.
code »
key(index) ?string
Gets the key for a given key index. If an index outside of [0..this.getCount()) is specified, this function returns null.
Arguments:
index : number
A key index.
Returns: ?string  A storage key, or null if the specified index is out of range.
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 »
constructor :
No description.
Code »
storage_ :
The web storage object (window.localStorage or window.sessionStorage).
Code »
constructor :
No description.
Code »

Static Properties

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

Package storage.mechanism

Package Reference