Object -
cache
:
LruEvictionPolicy
Represents the LruEvictionPolicy
object, which has LRU eviction algorithm related operations
based on a linked list data structure.
Methods
Update the linked list based on the get operation related to the LRU eviction algorithm.
Update the linked list based on the put operation related to the LRU eviction algorithm.
Update the linked list based on the remove operation related to the LRU eviction algorithm.
Update the linked list based on the replace operation related to the LRU eviction algorithm.
Update the linked list based on the clear operation related to the LRU eviction algorithm.
Update the linked list based on the evict operation related to the LRU eviction algorithm.
Update the linked list based on the get operation related to the LRU eviction algorithm.
Parameters
- list LinkedList
-
Linked list data structure
- node Node
-
Node of the linked list, which is retrieved
Update the linked list based on the put operation related to the LRU eviction algorithm.
Parameters
- list LinkedList
-
Linked list data structure
- node Node
-
Node of the linked list, which is added newly
Update the linked list based on the remove operation related to the LRU eviction algorithm.
Parameters
- list LinkedList
-
Linked list data structure
- node Node
-
Node of the linked list, which is deleted
Update the linked list based on the replace operation related to the LRU eviction algorithm.
Parameters
- list LinkedList
-
Linked list data structure
- newNode Node
-
Node of the linked list, which is used for replacing
- oldNode Node
-
Node of the linked list, which will be replaced
Update the linked list based on the clear operation related to the LRU eviction algorithm.
Parameters
- list LinkedList
-
Linked list data structure
Update the linked list based on the evict operation related to the LRU eviction algorithm.
Parameters
- list LinkedList
-
Linked list data structure
-
Return Type
(Node?) The Node, which should evict from the linked list or
()
if nothing to be evicted