Click or drag to resize

RankedMapTKey, TValueAdd Method

Adds an element with the supplied key and value.

Namespace:  Kaos.Collections
Assembly:  KaosCollections (in KaosCollections.dll) Version: 4.2.0.0
Syntax
C#
public bool Add(
	TKey key,
	TValue value
)

Parameters

key
Type: TKey
The key of the element to add.
value
Type: TValue
The value of the element to add. May be null.

Return Value

Type: Boolean
true if this is the first occurrence of an element with this key; otherwise false.
Exceptions
ExceptionCondition
ArgumentNullExceptionWhen key is null.
ArgumentExceptionWhen no comparer is available.
Remarks

This is a O(log n) operation.

Examples
The below snippet is part of a larger example of the RankedMapTKey, TValueclass.
C#
fmt.Add ("qt", "QuickTime movie clip");
fmt.Add ("jpeg", "JPEG bitmap image format");
fmt.Add ("sln", "Blend for Visual Studio");
fmt.Add ("sln", "Visual Studio 2017");
See Also