Package jodd.util
Class BinarySearchBase
- java.lang.Object
-
- jodd.util.BinarySearchBase
-
public abstract class BinarySearchBase extends java.lang.ObjectAbstract binary search. It is more abstract thenBinarySearch.
-
-
Constructor Summary
Constructors Constructor Description BinarySearchBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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.
-
-
-
Method Detail
-
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.
-
-