Class Index | File Index

Classes


Class Cache


Defined in: Utils.jsm.

Class Summary
Constructor Attributes Constructor Name and Description
 
Cache(size)
A cache with a fixed capacity, newer entries replace entries that have been stored first.
Field Summary
Field Attributes Field Name and Description
<private>  
Index in the ring buffer to be written next.
<private>  
Ring buffer storing hash keys, allows determining which keys need to be evicted.
 
Cache data, maps values to the keys.
Method Summary
Method Attributes Method Name and Description
 
add(key, value)
Adds a key and the corresponding value to the cache.
 
Clears cache contents.
Class Detail
Cache(size)
A cache with a fixed capacity, newer entries replace entries that have been stored first.
Parameters:
{Integer} size
Field Detail
<private> {Integer} _bufferIndex
Index in the ring buffer to be written next.

<private> {Array} _ringBuffer
Ring buffer storing hash keys, allows determining which keys need to be evicted.

{Object} data
Cache data, maps values to the keys. Read-only access, for writing use add() method.
Method Detail
add(key, value)
Adds a key and the corresponding value to the cache.
Parameters:
{String} key
value

clear()
Clears cache contents.

Documentation generated by JsDoc Toolkit 2.3.2 on Wed May 09 2012 10:50:20 GMT+0000 (UTC)