Click or drag to resize

CacheKeyType, ValueTypeTryGetNearest Method

Tries to get the value associated with the key nearest to the specified key.

Namespace: Demo3D.Visuals.KJE
Assembly: Demo3D.Core (in Demo3D.Core.dll) Version: 19.00.00
Syntax
C#
public bool TryGetNearest(
	KeyType key,
	ICacheKeyComparer<KeyType> comparer,
	out KeyType nearestKey,
	out ValueType nearestValue
)

Parameters

key  KeyType
The key.
comparer  ICacheKeyComparerKeyType
The comparer to use for comparing distances of keys.
nearestKey  KeyType
The key closest to the specified key.
nearestValue  ValueType
The value for the key closest to the specified key.

Return Value

Boolean
True if a value was obtained, false otherwise.
Remarks
This is an O(n) operation, where n is the number of entries in the cache.
See Also