indexNear

indexNear(value: MemberType): Integer;

The indexNear method of the Collection class returns an approximate index for the entry specified in the value parameter if it exists in the collection or it returns zero (0) if it does not exist. (See also the Iterator class startNearIndex method.)

If the specified value occurs more than once in the collection, the approximate index of the first occurrence is returned.

For the Set and MemberKeyDictionary subclasses, this method calculates and returns an approximate index. This incurs less processing overhead than using the indexOf method. For other subclasses of the Collection class, the indexNear method is the same as the indexOf method, and is included for compatibility.

Use the indexNear64 method instead of the indexNear method, if the number of entries in the collection could exceed the maximum integer value of 2,147,483,647.