Tanis.Collections.Heap.IndexOf C# (CSharp) Method

IndexOf() public method

IList implementation. Returns the index of the specified object in the list. If the list is sorted, a BinarySearch is performed using IComparer interface. Else the Object.Equals implementation of objects is used.
public IndexOf ( object O ) : int
O object The object to locate.
return int
		public int IndexOf(object O)
		{
			int Result = -1;
			Result = FList.BinarySearch(O, FComparer);
			while(Result>0 && FList[Result-1].Equals(O))
				Result--;
			return Result;
		}

Same methods

Heap::IndexOf ( object Object, Equality AreEqual ) : int
Heap::IndexOf ( object Object, int Start ) : int
Heap::IndexOf ( object Object, int Start, Equality AreEqual ) : int