Package org.opensearch.common.util
Class ArrayUtils
java.lang.Object
org.opensearch.common.util.ArrayUtils
Array utilities.
- Opensearch.internal:
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
binarySearch
(double[] array, double value, double tolerance) Return the index ofvalue
inarray
, or-1
if there is no such index.static String[]
Concatenates 2 arraysstatic <T> T[]
Concatenates 2 arrays
-
Method Details
-
binarySearch
public static int binarySearch(double[] array, double value, double tolerance) Return the index ofvalue
inarray
, or-1
if there is no such index. If there are several values that are withintolerance
or less ofvalue
, this method will return the index of the closest value. In case of several values being as close otvalue
, there is no guarantee which index will be returned. Results are undefined if the array is not sorted. -
concat
Concatenates 2 arrays -
concat
Concatenates 2 arrays
-