KGy SOFT

CircularSortedListTKey, TValueTryGetValue Method

KGy SOFT Core Libraries Help
Gets the value associated with the specified key.

Namespace:  KGySoft.Collections
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 6.0.0
Syntax

public bool TryGetValue(
	TKey key,
	out TValue value
)

Parameters

key
Type: TKey
The key whose value to get.
value
Type: TValue
When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Return Value

Type: Boolean
 if the CircularSortedListTKey, TValue contains an element with the specified key; otherwise, .

Implements

IDictionaryTKey, TValueTryGetValue(TKey, TValue)
IReadOnlyDictionaryTKey, TValueTryGetValue(TKey, TValue)
Exceptions

ExceptionCondition
ArgumentNullExceptionkey is .
Remarks

If the key is not found, then the value parameter gets the appropriate default value for the value type TValue; for example, zero (0) for integer types,  for Boolean types, and  for reference types.

This method performs a binary search; therefore, this method is an O(log n) operation, where n is Count.

See Also

Reference