Package jodd.util
Class BinarySearchBase
java.lang.Object
jodd.util.BinarySearchBase
Abstract binary search. It is more abstract then
BinarySearch.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract intcompare(int index) Compares element atindexposition with the target.intfind(int low, int high) Finds index of given element in inclusive index range.intfindFirst(int low, int high) Finds very first index of given element in inclusive index range.intfindLast(int low, int high) Finds very last index of given element in inclusive index range.
-
Constructor Details
-
BinarySearchBase
public BinarySearchBase()
-
-
Method Details
-
compare
protected abstract int compare(int index) Compares element atindexposition with the target. -
find
public int find(int low, int high) Finds index of given element in inclusive index range. Returns negative value if element is not found. -
findFirst
public int findFirst(int low, int high) Finds very first index of given element in inclusive index range. Returns negative value if element is not found. -
findLast
public int findLast(int low, int high) Finds very last index of given element in inclusive index range. Returns negative value if element is not found.
-