com.calitha.commons.IntegerList.IndexOf C# (CSharp) Method

IndexOf() public method

Searches for the specified Object and returns the zero-based index of the first occurrence within the section of the list that starts at the specified index and contains the specified number of elements.
public IndexOf ( int value, int startIndex, int count ) : int
value int The value to locate in the list.
startIndex int The zero-based starting index of the search.
count int The number of elements in the section to search.
return int
		public int IndexOf(int value, int startIndex, int count)
		{
			if ((startIndex < 0) || (startIndex >= list.Count))
				throw new ArgumentOutOfRangeException(); //TODO: arg
			if (count < 0)
				throw new ArgumentOutOfRangeException(); //TODO: arg
			if (startIndex + count > list.Count)
				throw new ArgumentOutOfRangeException(); //TODO: arg
			for (int i=startIndex; i < startIndex + count; i++)
			{
				if (this[i] == value)
					return i;
			}
			return -1;
		}

Same methods

IntegerList::IndexOf ( int value ) : int
IntegerList::IndexOf ( int value, int startIndex ) : int