lookup_iter


Description:

public SequenceIter<G> lookup_iter (G data, SequenceIterCompareFunc<G> iter_cmp)

Like lookup, but uses a SequenceIterCompareFunc instead of a CompareDataFunc as the compare function.

iter_cmp is called with two iterators pointing into this. It should return 0 if the iterators are equal, a negative value if the first iterator comes before the second, and a positive value if the second iterator comes before the first.

This function will fail if the data contained in the sequence is unsorted. Use insert_sorted or insert_sorted_iter to add data to your sequence or, if you want to add a large amount of data, call sort after doing unsorted insertions.

Parameters:

this

a Sequence

data

data to lookup

iter_cmp

the function used to compare iterators in the sequence

cmp_data

user data passed to iter_cmp

Returns:

an SequenceIter pointing to the position of the first item found equal to data according to cmp_func and cmp_data, or null if no such item exists