public void Touch(
TKey key
)
Public Sub Touch (
key As TKey
)
public:
void Touch(
TKey key
)
member Touch :
key : 'TKey -> unit
CacheTKey, TValue maintains an evaluation order for the stored elements. When the CacheTKey, TValue is full (that is when Count equals to Capacity), then adding a new element will drop the element, which is the first one in the evaluation order. By calling this method, the element with the specified key will be sent to the back in the evaluation order.
When Behavior is RemoveLeastRecentUsedElement (which is the default behavior), then whenever an existing element is accessed in the CacheTKey, TValue, then it will be touched internally.
This method approaches an O(1) operation.
ArgumentNullException | key is . |
KeyNotFoundException | key does not exist in the CacheTKey, TValue. |