Class SearchUtil


  • public class SearchUtil
    extends Object
    • Constructor Detail

      • SearchUtil

        public SearchUtil()
    • Method Detail

      • intBinarySearch

        public static <T> int intBinarySearch​(SearchUtil.IntComparator comparator,
                                              int startIndex,
                                              int count)
        Method to search over any kind of sorted range. The comparator is called with an int following the binary search algorithm until a match or the range is exhausted.
        Returns:
        the matching value or -1 if we exhausted the range.