Object - cache : LruEvictionPolicy

Represents the LruEvictionPolicy object, which has LRU eviction algorithm related operations based on a linked list data structure.

get

Update the linked list based on the get operation related to the LRU eviction algorithm.

Parameters

  • node Node
  • Node of the linked list, which is retrieved

put

Update the linked list based on the put operation related to the LRU eviction algorithm.

Parameters

  • node Node
  • Node of the linked list, which is added newly

remove

Update the linked list based on the remove operation related to the LRU eviction algorithm.

Parameters

  • node Node
  • Node of the linked list, which is deleted

replace

Update the linked list based on the replace operation related to the LRU eviction algorithm.

Parameters

  • newNode Node
  • Node of the linked list, which is used for replacing

  • oldNode Node
  • Node of the linked list, which will be replaced

clear

Update the linked list based on the clear operation related to the LRU eviction algorithm.

Parameters

evict

(LinkedList list)

returns Node?

Update the linked list based on the evict operation related to the LRU eviction algorithm.

Parameters

  • Return Type

    (Node?)
  • The Node, which should evict from the linked list or () if nothing to be evicted