Class: LRUCache

ol/structs/LRUCache~LRUCache


Implements a Least-Recently-Used cache where the keys do not conflict with Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring items from the cache is the responsibility of the user.

Fires:

Extends

Methods

dispatchEvent(event){boolean|undefined} inherited

events/Target.js, line 96

Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a type property.

Name Type Description
event Object | module:ol/events/Event~BaseEvent | string

Event object.

Returns:
false if anyone called preventDefault on the event object or if any of the listeners returned false.

setSize(size)

structs/LRUCache.js, line 285

Set a maximum number of entries for the cache.

Name Type Description
size number

Cache size.