Top Inners Constructors Methods
com.openhtmltopdf.util

public Class SearchUtil

extends Object
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <T> int

Returns:

the matching value or -1 if we exhausted the range.
intBinarySearch
(SearchUtil.IntComparator comparator, int startIndex, int count)

Method to search over any kind of sorted range.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SearchUtilback to summary
public SearchUtil()

Method Detail

intBinarySearchback to summary
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:int

the matching value or -1 if we exhausted the range.

com.openhtmltopdf.util back to summary

public Interface SearchUtil.IntComparator


Method Summary

Modifier and TypeMethod and Description
public int
compare(int index)

Return 0 for a match, -1 (too low) if we should continue searching after the index and +1 (too high) if we should continue searching before the index.

Method Detail

compareback to summary
public int compare(int index)

Return 0 for a match, -1 (too low) if we should continue searching after the index and +1 (too high) if we should continue searching before the index.