Package org.elasticsearch.common.util
Class ArrayUtils
java.lang.Object
org.elasticsearch.common.util.ArrayUtils
public class ArrayUtils
extends java.lang.Object
-
Method Summary
Modifier and Type Method Description static intbinarySearch(double[] array, double value, double tolerance)Return the index ofvalueinarray, or-1if there is no such index.static java.lang.String[]concat(java.lang.String[] one, java.lang.String[] other)Concatenates 2 arraysstatic <T> T[]concat(T[] one, T[] other, java.lang.Class<T> clazz)Concatenates 2 arraysMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
binarySearch
public static int binarySearch(double[] array, double value, double tolerance)Return the index ofvalueinarray, or-1if there is no such index. If there are several values that are withintoleranceor 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
public static java.lang.String[] concat(java.lang.String[] one, java.lang.String[] other)Concatenates 2 arrays -
concat
public static <T> T[] concat(T[] one, T[] other, java.lang.Class<T> clazz)Concatenates 2 arrays
-