Click or drag to resize

RankedBagTAdd Method (T, Int32)

Adds a supplied number of occurrences of the supplied item to the bag.

Namespace:  Kaos.Collections
Assembly:  KaosCollections (in KaosCollections.dll) Version: 4.2.0.0
Syntax
C#
public bool Add(
	T item,
	int count
)

Parameters

item
Type: T
The item to add.
count
Type: SystemInt32
The number of copies to add.

Return Value

Type: Boolean
true if item was not already in the bag; otherwise false.
Exceptions
ExceptionCondition
ArgumentExceptionWhen count is less than zero.
Remarks

If the supplied item already occurs in the bag then the new item is added sequentially following the old items.

This is a O(m log n) operation where m is count and n is Count.

See Also