Package com.openhtmltopdf.util
Class SearchUtil
java.lang.Object
com.openhtmltopdf.util.SearchUtil
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> int
intBinarySearch
(SearchUtil.IntComparator comparator, int startIndex, int count) Method to search over any kind of sorted range.
-
Constructor Details
-
SearchUtil
public SearchUtil()
-
-
Method Details
-
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.
-