FastLookupCollectionTGetItemIndex Method

Gets the zero-based index of the first of the specified item within the FastLookupCollectionT.

Definition

Namespace: KGySoft.Collections.ObjectModel
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
protected override int GetItemIndex(
	T item
)

Parameters

item  T
The object to locate in the FastLookupCollectionT. The value can be for reference types.

Return Value

Int32
The zero-based index of the found occurrence of item within the FastLookupCollectionT, if found; otherwise, -1.

Remarks

In FastLookupCollectionT this method has an O(n) cost for the first time or then the internal mapping has to be rebuilt (because, for example, CheckConsistency is and inconsistency is detected); otherwise, it has an O(1) cost. Inconsistency can happen if the underlying collection has been modified directly instead of accessing it only via this instance.

See Also