Maps API for JavaScript Developer's Guide

H.util.ICache

Interface Summary

An interface definition for the generic cache. Any data elements can be stored in the cache. They are always associated with an identifier to retrieve them at a later stage and their content size.

[ For full details, see the Interface Details ]

Method Summary

Table 1. Methods
Methods

add (id, data, size) : {boolean}

This method adds an element to the cache.

get (id, opt_noUpdate) : {*}

This method retrieves an element from the cache.

drop (id)

This method explicitly drops an element from the cache.

forEach (callback, opt_ctx, opt_matcher)

This method will execute the provided callback function on each of the cache's entries. If the optional match predicate is passed to this method the callback will only be executed on those entries for which the predicated returns true.

removeAll (opt_matcher)

This method removes all data elements from the cache. If the optional match predicate is passed to this method only those data elements will be removed for which the predicate return true.

registerOnDrop (callback)

This method registers a callback that should be called each time an entry is dropped from the cache.

Interface Description

An interface definition for the generic cache. Any data elements can be stored in the cache. They are always associated with an identifier to retrieve them at a later stage and their content size.

Method Details

add (id, data, size) : {boolean}

This method adds an element to the cache.

Parameters:
 
id:
{*}
 
The identifier of this data element, the value is converted to a string.
data:
{*}
 
the actual data to be stored
size:
{number}
 
the size of the data element
Returns:
 
{boolean}
a boolean value indicating whether the data was added

get (id, opt_noUpdate) : {*}

This method retrieves an element from the cache.

Parameters:
 
id:
{string}
 
the ID of the data element to be retrieved.
opt_noUpdate:
{boolean=} [optional]
 
and optional flag to indicate that the retrieved object should not be marked as 'most recently used'.
Returns:
 
{*}
returns the data associated with the ID or undefined if the data element is not currently in the cache.

drop (id)

This method explicitly drops an element from the cache.

Parameters:
 
id:
{*}
 
the id of the item to drop

forEach (callback, opt_ctx, opt_matcher)

This method will execute the provided callback function on each of the cache's entries. If the optional match predicate is passed to this method the callback will only be executed on those entries for which the predicated returns true.

Parameters:
 
callback:
{function(string, ?, number)}
 
the callback to be invoked for each entry
opt_ctx:
{Object=} [optional]
 
an optional context object to be used as this within the callback
opt_matcher:
{(function(string, ?, number) : boolean)=} [optional]
 
an optional match predicate to customize on which entries the callback will be called

removeAll (opt_matcher)

This method removes all data elements from the cache. If the optional match predicate is passed to this method only those data elements will be removed for which the predicate return true.

Parameters:
 
opt_matcher:
{(function(string, ?, number) : boolean)=} [optional]
 
an optional function that receives an entries id, data and size and may return true or false to either remove it or leave the entry in the cache respectively

registerOnDrop (callback)

This method registers a callback that should be called each time an entry is dropped from the cache.

Parameters:
 
callback:
{(function(string, ?, number))}
 
the callback to be invoked for each entry

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.