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: 15.0.2.11458
Syntax
C#
public bool TryGetNearest(
	KeyType key,
	ICacheKeyComparer<KeyType> comparer,
	out KeyType nearestKey,
	out ValueType nearestValue
)

Parameters

key
Type: KeyType
The key.
comparer
Type: Demo3D.Visuals.KJEICacheKeyComparerKeyType
The comparer to use for comparing distances of keys.
nearestKey
Type: KeyType
The key closest to the specified key.
nearestValue
Type: ValueType
The value for the key closest to the specified key.

Return Value

Type: 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