CacheKeyType, ValueTypeTryGetNearest Method |
Tries to get the value associated with the key nearest to the specified key.
Namespace: Demo3D.Visuals.KJEAssembly: Demo3D.Core (in Demo3D.Core.dll) Version: 19.00.00
Syntaxpublic 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
BooleanTrue 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