Class LRU
A doubly-linked-list of the least recently used elements.
Defined in: LRU.js.
Constructor Attributes | Constructor Name and Description |
---|---|
LRU()
|
Method Attributes | Method Name and Description |
---|---|
contains(node)
|
|
removes the least recently used item from the list and returns it.
|
|
size()
number of elements in the list
|
|
toString()
|
|
touch(node)
makes node the most recently used item.
|
Method Detail
contains(node)
- Parameters:
- node
getLRUItem()
removeLRUItem()
removes the least recently used item from the list and returns it.
if the list was empty, null will be returned.
{Number}
size()
number of elements in the list
- Returns:
- {Number}
toString()
touch(node)
makes node the most recently used item. if the list does not contain node, it will be added.
- Parameters:
- node