Package org.elasticsearch.common.util
Class BigArrays.DoubleBinarySearcher
java.lang.Object
org.elasticsearch.common.util.BinarySearcher
org.elasticsearch.common.util.BigArrays.DoubleBinarySearcher
- Enclosing class:
- BigArrays
-
Constructor Summary
-
Method Summary
Methods inherited from class org.elasticsearch.common.util.BinarySearcher
search
-
Constructor Details
-
DoubleBinarySearcher
-
-
Method Details
-
compare
protected int compare(int index)- Specified by:
compare
in classBinarySearcher
- Returns:
- a negative integer, zero, or a positive integer if the array's value at
index
is less than, equal to, or greater than the value being searched for.
-
distance
protected double distance(int index)- Specified by:
distance
in classBinarySearcher
- Returns:
- the magnitude of the distance between the element at
index
and the value being searched for. It will usually beMath.abs(array[index] - searchValue)
.
-
search
public int search(int from, int to, double searchFor)
-