Package com.openhtmltopdf.util
Class SearchUtil
- java.lang.Object
-
- com.openhtmltopdf.util.SearchUtil
-
public class SearchUtil extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SearchUtil.IntComparator
-
Constructor Summary
Constructors Constructor Description SearchUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> int
intBinarySearch(SearchUtil.IntComparator comparator, int startIndex, int count)
Method to search over any kind of sorted range.
-
-
-
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.
-
-