Top Description Inners Fields Constructors Methods
java.util

public final Class Arrays

extends Object
Class Inheritance
Imports
jdk.internal.util.ArraysSupport, jdk.internal.vm.annotation.IntrinsicCandidate, java.io.Serializable, java.lang.reflect.Array, java.util.concurrent.ForkJoinPool, java.util.function.BinaryOperator, .Consumer, .DoubleBinaryOperator, .IntBinaryOperator, .IntFunction, .IntToDoubleFunction, .IntToLongFunction, .IntUnaryOperator, .LongBinaryOperator, .UnaryOperator, java.util.stream.DoubleStream, .IntStream, .LongStream, .Stream, .StreamSupport

This class contains various methods for manipulating arrays (such as sorting and searching). This class also contains a static factory that allows arrays to be viewed as lists.

The methods in this class all throw a NullPointerException, if the specified array reference is null, except where noted.

The documentation for the methods contained in this class includes brief descriptions of the implementations. Such descriptions should be regarded as implementation notes, rather than parts of the

Specification

Implementors should feel free to substitute other algorithms, so long as the specification itself is adhered to. (For example, the algorithm used by sort(Object[]) does not have to be a MergeSort, but it does have to be stable.)

This class is a member of the Java Collections Framework.

Authors
Josh Bloch, Neal Gafter, John Rose
Since
1.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
pack-priv static class
Arrays.LegacyMergeSort

Old merge sort implementation can be selected (for compatibility with broken comparators) using a system property.

pack-priv static class
Arrays.NaturalOrder

A comparator that implements the natural ordering of a group of mutually comparable elements.

Field Summary

Modifier and TypeField and Description
private static final int
INSERTIONSORT_THRESHOLD

Tuning parameter: list size at or below which insertion sort will be used in preference to mergesort.

private static final int
MIN_ARRAY_SORT_GRAN

The minimum array length below which a parallel sorting algorithm will not further partition the sorting task.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <
the class of the objects in the array
T
>
List<T>

Returns:

a list view of the specified array
asList
(T...
the array by which the list will be backed
a
)

Returns a fixed-size list backed by the specified array.

public static int

Returns:

index of the search key, if it is contained in the array; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element greater than the key, or a.length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(long[]
the array to be searched
a
,
long
the value to be searched for
key
)

Searches the specified array of longs for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element in the range greater than the key, or toIndex if all elements in the range are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(long[]
the array to be searched
a
,
int
the index of the first element (inclusive) to be searched
fromIndex
,
int
the index of the last element (exclusive) to be searched
toIndex
,
long
the value to be searched for
key
)

Searches a range of the specified array of longs for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element greater than the key, or a.length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(int[]
the array to be searched
a
,
int
the value to be searched for
key
)

Searches the specified array of ints for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element in the range greater than the key, or toIndex if all elements in the range are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(int[]
the array to be searched
a
,
int
the index of the first element (inclusive) to be searched
fromIndex
,
int
the index of the last element (exclusive) to be searched
toIndex
,
int
the value to be searched for
key
)

Searches a range of the specified array of ints for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element greater than the key, or a.length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(short[]
the array to be searched
a
,
short
the value to be searched for
key
)

Searches the specified array of shorts for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element in the range greater than the key, or toIndex if all elements in the range are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(short[]
the array to be searched
a
,
int
the index of the first element (inclusive) to be searched
fromIndex
,
int
the index of the last element (exclusive) to be searched
toIndex
,
short
the value to be searched for
key
)

Searches a range of the specified array of shorts for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element greater than the key, or a.length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(char[]
the array to be searched
a
,
char
the value to be searched for
key
)

Searches the specified array of chars for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element in the range greater than the key, or toIndex if all elements in the range are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(char[]
the array to be searched
a
,
int
the index of the first element (inclusive) to be searched
fromIndex
,
int
the index of the last element (exclusive) to be searched
toIndex
,
char
the value to be searched for
key
)

Searches a range of the specified array of chars for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element greater than the key, or a.length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(byte[]
the array to be searched
a
,
byte
the value to be searched for
key
)

Searches the specified array of bytes for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element in the range greater than the key, or toIndex if all elements in the range are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(byte[]
the array to be searched
a
,
int
the index of the first element (inclusive) to be searched
fromIndex
,
int
the index of the last element (exclusive) to be searched
toIndex
,
byte
the value to be searched for
key
)

Searches a range of the specified array of bytes for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element greater than the key, or a.length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(double[]
the array to be searched
a
,
double
the value to be searched for
key
)

Searches the specified array of doubles for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element in the range greater than the key, or toIndex if all elements in the range are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(double[]
the array to be searched
a
,
int
the index of the first element (inclusive) to be searched
fromIndex
,
int
the index of the last element (exclusive) to be searched
toIndex
,
double
the value to be searched for
key
)

Searches a range of the specified array of doubles for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element greater than the key, or a.length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(float[]
the array to be searched
a
,
float
the value to be searched for
key
)

Searches the specified array of floats for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element in the range greater than the key, or toIndex if all elements in the range are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(float[]
the array to be searched
a
,
int
the index of the first element (inclusive) to be searched
fromIndex
,
int
the index of the last element (exclusive) to be searched
toIndex
,
float
the value to be searched for
key
)

Searches a range of the specified array of floats for the specified value using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element greater than the key, or a.length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(Object[]
the array to be searched
a
,
Object
the value to be searched for
key
)

Searches the specified array for the specified object using the binary search algorithm.

public static int

Returns:

index of the search key, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element in the range greater than the key, or toIndex if all elements in the range are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(Object[]
the array to be searched
a
,
int
the index of the first element (inclusive) to be searched
fromIndex
,
int
the index of the last element (exclusive) to be searched
toIndex
,
Object
the value to be searched for
key
)

Searches a range of the specified array for the specified object using the binary search algorithm.

public static <
the class of the objects in the array
T
>
int

Returns:

index of the search key, if it is contained in the array; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element greater than the key, or a.length if all elements in the array are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(T[]
the array to be searched
a
,
T
the value to be searched for
key
,
Comparator<? super T>
the comparator by which the array is ordered. A null value indicates that the elements' natural ordering should be used.
c
)

Searches the specified array for the specified object using the binary search algorithm.

public static <
the class of the objects in the array
T
>
int

Returns:

index of the search key, if it is contained in the array within the specified range; otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which the key would be inserted into the array: the index of the first element in the range greater than the key, or toIndex if all elements in the range are less than the specified key. Note that this guarantees that the return value will be >= 0 if and only if the key is found.
binarySearch
(T[]
the array to be searched
a
,
int
the index of the first element (inclusive) to be searched
fromIndex
,
int
the index of the last element (exclusive) to be searched
toIndex
,
T
the value to be searched for
key
,
Comparator<? super T>
the comparator by which the array is ordered. A null value indicates that the elements' natural ordering should be used.
c
)

Searches a range of the specified array for the specified object using the binary search algorithm.

private static int
binarySearch0(long[] a, int fromIndex, int toIndex, long key)

private static int
binarySearch0(int[] a, int fromIndex, int toIndex, int key)

private static int
binarySearch0(short[] a, int fromIndex, int toIndex, short key)

private static int
binarySearch0(char[] a, int fromIndex, int toIndex, char key)

private static int
binarySearch0(byte[] a, int fromIndex, int toIndex, byte key)

private static int
binarySearch0(double[] a, int fromIndex, int toIndex, double key)

private static int
binarySearch0(float[] a, int fromIndex, int toIndex, float key)

private static int
binarySearch0(Object[] a, int fromIndex, int toIndex, Object key)

private static <T> int
binarySearch0(T[] a, int fromIndex, int toIndex, T key, Comparator<? super T> c)

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compare
(boolean[]
the first array to compare
a
,
boolean[]
the second array to compare
b
)

Compares two boolean arrays lexicographically.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compare
(boolean[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
boolean[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two boolean arrays lexicographically over the specified ranges.

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compare
(byte[]
the first array to compare
a
,
byte[]
the second array to compare
b
)

Compares two byte arrays lexicographically.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compare
(byte[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
byte[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two byte arrays lexicographically over the specified ranges.

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compare
(short[]
the first array to compare
a
,
short[]
the second array to compare
b
)

Compares two short arrays lexicographically.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compare
(short[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
short[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two short arrays lexicographically over the specified ranges.

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compare
(char[]
the first array to compare
a
,
char[]
the second array to compare
b
)

Compares two char arrays lexicographically.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compare
(char[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
char[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two char arrays lexicographically over the specified ranges.

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compare
(int[]
the first array to compare
a
,
int[]
the second array to compare
b
)

Compares two int arrays lexicographically.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compare
(int[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
int[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two int arrays lexicographically over the specified ranges.

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compare
(long[]
the first array to compare
a
,
long[]
the second array to compare
b
)

Compares two long arrays lexicographically.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compare
(long[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
long[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two long arrays lexicographically over the specified ranges.

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compare
(float[]
the first array to compare
a
,
float[]
the second array to compare
b
)

Compares two float arrays lexicographically.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compare
(float[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
float[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two float arrays lexicographically over the specified ranges.

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compare
(double[]
the first array to compare
a
,
double[]
the second array to compare
b
)

Compares two double arrays lexicographically.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compare
(double[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
double[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two double arrays lexicographically over the specified ranges.

public static <
the type of comparable array elements
T extends Comparable<? super T>
>
int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compare
(T[]
the first array to compare
a
,
T[]
the second array to compare
b
)

Compares two Object arrays, within comparable elements, lexicographically.

public static <
the type of comparable array elements
T extends Comparable<? super T>
>
int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compare
(T[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
T[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two Object arrays lexicographically over the specified ranges.

public static <
the type of array elements
T
>
int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compare
(T[]
the first array to compare
a
,
T[]
the second array to compare
b
,
Comparator<? super T>
the comparator to compare array elements
cmp
)

Compares two Object arrays lexicographically using a specified comparator.

public static <
the type of array elements
T
>
int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compare
(T[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
T[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
,
Comparator<? super T>
the comparator to compare array elements
cmp
)

Compares two Object arrays lexicographically over the specified ranges.

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compareUnsigned
(byte[]
the first array to compare
a
,
byte[]
the second array to compare
b
)

Compares two byte arrays lexicographically, numerically treating elements as unsigned.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compareUnsigned
(byte[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
byte[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two byte arrays lexicographically over the specified ranges, numerically treating elements as unsigned.

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compareUnsigned
(short[]
the first array to compare
a
,
short[]
the second array to compare
b
)

Compares two short arrays lexicographically, numerically treating elements as unsigned.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compareUnsigned
(short[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
short[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two short arrays lexicographically over the specified ranges, numerically treating elements as unsigned.

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compareUnsigned
(int[]
the first array to compare
a
,
int[]
the second array to compare
b
)

Compares two int arrays lexicographically, numerically treating elements as unsigned.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compareUnsigned
(int[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
int[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two int arrays lexicographically over the specified ranges, numerically treating elements as unsigned.

public static int

Returns:

the value 0 if the first and second array are equal and contain the same elements in the same order; a value less than 0 if the first array is lexicographically less than the second array; and a value greater than 0 if the first array is lexicographically greater than the second array
compareUnsigned
(long[]
the first array to compare
a
,
long[]
the second array to compare
b
)

Compares two long arrays lexicographically, numerically treating elements as unsigned.

public static int

Returns:

the value 0 if, over the specified ranges, the first and second array are equal and contain the same elements in the same order; a value less than 0 if, over the specified ranges, the first array is lexicographically less than the second array; and a value greater than 0 if, over the specified ranges, the first array is lexicographically greater than the second array
compareUnsigned
(long[]
the first array to compare
a
,
int
the index (inclusive) of the first element in the first array to be compared
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be compared
aToIndex
,
long[]
the second array to compare
b
,
int
the index (inclusive) of the first element in the second array to be compared
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be compared
bToIndex
)

Compares two long arrays lexicographically over the specified ranges, numerically treating elements as unsigned.

public static <
the class of the objects in the array
T
>
T[]

Returns:

a copy of the original array, truncated or padded with nulls to obtain the specified length
copyOf
(T[]
the array to be copied
original
,
int
the length of the copy to be returned
newLength
)

Copies the specified array, truncating or padding with nulls (if necessary) so the copy has the specified length.

public static <
the class of the objects in the returned array
T
,
the class of the objects in the original array
U
>
T[]

Returns:

a copy of the original array, truncated or padded with nulls to obtain the specified length
copyOf
(U[]
the array to be copied
original
,
int
the length of the copy to be returned
newLength
,
Class<? extends T[]>
the class of the copy to be returned
newType
)

Copies the specified array, truncating or padding with nulls (if necessary) so the copy has the specified length.

public static byte[]

Returns:

a copy of the original array, truncated or padded with zeros to obtain the specified length
copyOf
(byte[]
the array to be copied
original
,
int
the length of the copy to be returned
newLength
)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length.

public static short[]

Returns:

a copy of the original array, truncated or padded with zeros to obtain the specified length
copyOf
(short[]
the array to be copied
original
,
int
the length of the copy to be returned
newLength
)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length.

public static int[]

Returns:

a copy of the original array, truncated or padded with zeros to obtain the specified length
copyOf
(int[]
the array to be copied
original
,
int
the length of the copy to be returned
newLength
)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length.

public static long[]

Returns:

a copy of the original array, truncated or padded with zeros to obtain the specified length
copyOf
(long[]
the array to be copied
original
,
int
the length of the copy to be returned
newLength
)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length.

public static char[]

Returns:

a copy of the original array, truncated or padded with null characters to obtain the specified length
copyOf
(char[]
the array to be copied
original
,
int
the length of the copy to be returned
newLength
)

Copies the specified array, truncating or padding with null characters (if necessary) so the copy has the specified length.

public static float[]

Returns:

a copy of the original array, truncated or padded with zeros to obtain the specified length
copyOf
(float[]
the array to be copied
original
,
int
the length of the copy to be returned
newLength
)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length.

public static double[]

Returns:

a copy of the original array, truncated or padded with zeros to obtain the specified length
copyOf
(double[]
the array to be copied
original
,
int
the length of the copy to be returned
newLength
)

Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length.

public static boolean[]

Returns:

a copy of the original array, truncated or padded with false elements to obtain the specified length
copyOf
(boolean[]
the array to be copied
original
,
int
the length of the copy to be returned
newLength
)

Copies the specified array, truncating or padding with false (if necessary) so the copy has the specified length.

public static <
the class of the objects in the array
T
>
T[]

Returns:

a new array containing the specified range from the original array, truncated or padded with nulls to obtain the required length
copyOfRange
(T[]
the array from which a range is to be copied
original
,
int
the initial index of the range to be copied, inclusive
from
,
int
the final index of the range to be copied, exclusive. (This index may lie outside the array.)
to
)

Copies the specified range of the specified array into a new array.

public static <
the class of the objects in the returned array
T
,
the class of the objects in the original array
U
>
T[]

Returns:

a new array containing the specified range from the original array, truncated or padded with nulls to obtain the required length
copyOfRange
(U[]
the array from which a range is to be copied
original
,
int
the initial index of the range to be copied, inclusive
from
,
int
the final index of the range to be copied, exclusive. (This index may lie outside the array.)
to
,
Class<? extends T[]>
the class of the copy to be returned
newType
)

Copies the specified range of the specified array into a new array.

public static byte[]

Returns:

a new array containing the specified range from the original array, truncated or padded with zeros to obtain the required length
copyOfRange
(byte[]
the array from which a range is to be copied
original
,
int
the initial index of the range to be copied, inclusive
from
,
int
the final index of the range to be copied, exclusive. (This index may lie outside the array.)
to
)

Copies the specified range of the specified array into a new array.

public static short[]

Returns:

a new array containing the specified range from the original array, truncated or padded with zeros to obtain the required length
copyOfRange
(short[]
the array from which a range is to be copied
original
,
int
the initial index of the range to be copied, inclusive
from
,
int
the final index of the range to be copied, exclusive. (This index may lie outside the array.)
to
)

Copies the specified range of the specified array into a new array.

public static int[]

Returns:

a new array containing the specified range from the original array, truncated or padded with zeros to obtain the required length
copyOfRange
(int[]
the array from which a range is to be copied
original
,
int
the initial index of the range to be copied, inclusive
from
,
int
the final index of the range to be copied, exclusive. (This index may lie outside the array.)
to
)

Copies the specified range of the specified array into a new array.

public static long[]

Returns:

a new array containing the specified range from the original array, truncated or padded with zeros to obtain the required length
copyOfRange
(long[]
the array from which a range is to be copied
original
,
int
the initial index of the range to be copied, inclusive
from
,
int
the final index of the range to be copied, exclusive. (This index may lie outside the array.)
to
)

Copies the specified range of the specified array into a new array.

public static char[]

Returns:

a new array containing the specified range from the original array, truncated or padded with null characters to obtain the required length
copyOfRange
(char[]
the array from which a range is to be copied
original
,
int
the initial index of the range to be copied, inclusive
from
,
int
the final index of the range to be copied, exclusive. (This index may lie outside the array.)
to
)

Copies the specified range of the specified array into a new array.

public static float[]

Returns:

a new array containing the specified range from the original array, truncated or padded with zeros to obtain the required length
copyOfRange
(float[]
the array from which a range is to be copied
original
,
int
the initial index of the range to be copied, inclusive
from
,
int
the final index of the range to be copied, exclusive. (This index may lie outside the array.)
to
)

Copies the specified range of the specified array into a new array.

public static double[]

Returns:

a new array containing the specified range from the original array, truncated or padded with zeros to obtain the required length
copyOfRange
(double[]
the array from which a range is to be copied
original
,
int
the initial index of the range to be copied, inclusive
from
,
int
the final index of the range to be copied, exclusive. (This index may lie outside the array.)
to
)

Copies the specified range of the specified array into a new array.

public static boolean[]

Returns:

a new array containing the specified range from the original array, truncated or padded with false elements to obtain the required length
copyOfRange
(boolean[]
the array from which a range is to be copied
original
,
int
the initial index of the range to be copied, inclusive
from
,
int
the final index of the range to be copied, exclusive. (This index may lie outside the array.)
to
)

Copies the specified range of the specified array into a new array.

public static boolean

Returns:

true if the two arrays are equal
deepEquals
(Object[]
one array to be tested for equality
a1
,
Object[]
the other array to be tested for equality
a2
)

Returns true if the two specified arrays are deeply equal to one another.

pack-priv static boolean
public static int

Returns:

a deep-content-based hash code for a
deepHashCode
(Object[]
the array whose deep-content-based hash code to compute
a
)

Returns a hash code based on the "deep contents" of the specified array.

public static String

Returns:

a string representation of a
deepToString
(Object[]
the array whose string representation to return
a
)

Returns a string representation of the "deep contents" of the specified array.

private static void
public static boolean

Returns:

true if the two arrays are equal
equals
(long[]
one array to be tested for equality
a
,
long[]
the other array to be tested for equality
a2
)

Returns true if the two specified arrays of longs are equal to one another.

public static boolean

Returns:

true if the two arrays, over the specified ranges, are equal
equals
(long[]
the first array to be tested for equality
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
long[]
the second array to be tested for equality
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Returns true if the two specified arrays of longs, over the specified ranges, are equal to one another.

public static boolean

Returns:

true if the two arrays are equal
equals
(int[]
one array to be tested for equality
a
,
int[]
the other array to be tested for equality
a2
)

Returns true if the two specified arrays of ints are equal to one another.

public static boolean

Returns:

true if the two arrays, over the specified ranges, are equal
equals
(int[]
the first array to be tested for equality
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
int[]
the second array to be tested for equality
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Returns true if the two specified arrays of ints, over the specified ranges, are equal to one another.

public static boolean

Returns:

true if the two arrays are equal
equals
(short[]
one array to be tested for equality
a
,
short[]
the other array to be tested for equality
a2
)

Returns true if the two specified arrays of shorts are equal to one another.

public static boolean

Returns:

true if the two arrays, over the specified ranges, are equal
equals
(short[]
the first array to be tested for equality
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
short[]
the second array to be tested for equality
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Returns true if the two specified arrays of shorts, over the specified ranges, are equal to one another.

public static boolean

Returns:

true if the two arrays are equal
equals
(char[]
one array to be tested for equality
a
,
char[]
the other array to be tested for equality
a2
)

Returns true if the two specified arrays of chars are equal to one another.

public static boolean

Returns:

true if the two arrays, over the specified ranges, are equal
equals
(char[]
the first array to be tested for equality
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
char[]
the second array to be tested for equality
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Returns true if the two specified arrays of chars, over the specified ranges, are equal to one another.

public static boolean

Returns:

true if the two arrays are equal
equals
(byte[]
one array to be tested for equality
a
,
byte[]
the other array to be tested for equality
a2
)

Returns true if the two specified arrays of bytes are equal to one another.

public static boolean

Returns:

true if the two arrays, over the specified ranges, are equal
equals
(byte[]
the first array to be tested for equality
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
byte[]
the second array to be tested for equality
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Returns true if the two specified arrays of bytes, over the specified ranges, are equal to one another.

public static boolean

Returns:

true if the two arrays are equal
equals
(boolean[]
one array to be tested for equality
a
,
boolean[]
the other array to be tested for equality
a2
)

Returns true if the two specified arrays of booleans are equal to one another.

public static boolean

Returns:

true if the two arrays, over the specified ranges, are equal
equals
(boolean[]
the first array to be tested for equality
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
boolean[]
the second array to be tested for equality
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Returns true if the two specified arrays of booleans, over the specified ranges, are equal to one another.

public static boolean

Returns:

true if the two arrays are equal
equals
(double[]
one array to be tested for equality
a
,
double[]
the other array to be tested for equality
a2
)

Returns true if the two specified arrays of doubles are equal to one another.

public static boolean

Returns:

true if the two arrays, over the specified ranges, are equal
equals
(double[]
the first array to be tested for equality
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
double[]
the second array to be tested for equality
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Returns true if the two specified arrays of doubles, over the specified ranges, are equal to one another.

public static boolean

Returns:

true if the two arrays are equal
equals
(float[]
one array to be tested for equality
a
,
float[]
the other array to be tested for equality
a2
)

Returns true if the two specified arrays of floats are equal to one another.

public static boolean

Returns:

true if the two arrays, over the specified ranges, are equal
equals
(float[]
the first array to be tested for equality
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
float[]
the second array to be tested for equality
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Returns true if the two specified arrays of floats, over the specified ranges, are equal to one another.

public static boolean

Returns:

true if the two arrays are equal
equals
(Object[]
one array to be tested for equality
a
,
Object[]
the other array to be tested for equality
a2
)

Returns true if the two specified arrays of Objects are equal to one another.

public static boolean

Returns:

true if the two arrays, over the specified ranges, are equal
equals
(Object[]
the first array to be tested for equality
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
Object[]
the second array to be tested for equality
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Returns true if the two specified arrays of Objects, over the specified ranges, are equal to one another.

public static <
the type of array elements
T
>
boolean

Returns:

true if the two arrays are equal
equals
(T[]
one array to be tested for equality
a
,
T[]
the other array to be tested for equality
a2
,
Comparator<? super T>
the comparator to compare array elements
cmp
)

Returns true if the two specified arrays of Objects are equal to one another.

public static <
the type of array elements
T
>
boolean

Returns:

true if the two arrays, over the specified ranges, are equal
equals
(T[]
the first array to be tested for equality
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
T[]
the second array to be tested for equality
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
,
Comparator<? super T>
the comparator to compare array elements
cmp
)

Returns true if the two specified arrays of Objects, over the specified ranges, are equal to one another.

public static void
fill(long[]
the array to be filled
a
,
long
the value to be stored in all elements of the array
val
)

Assigns the specified long value to each element of the specified array of longs.

public static void
fill(long[]
the array to be filled
a
,
int
the index of the first element (inclusive) to be filled with the specified value
fromIndex
,
int
the index of the last element (exclusive) to be filled with the specified value
toIndex
,
long
the value to be stored in all elements of the array
val
)

Assigns the specified long value to each element of the specified range of the specified array of longs.

public static void
fill(int[]
the array to be filled
a
,
int
the value to be stored in all elements of the array
val
)

Assigns the specified int value to each element of the specified array of ints.

public static void
fill(int[]
the array to be filled
a
,
int
the index of the first element (inclusive) to be filled with the specified value
fromIndex
,
int
the index of the last element (exclusive) to be filled with the specified value
toIndex
,
int
the value to be stored in all elements of the array
val
)

Assigns the specified int value to each element of the specified range of the specified array of ints.

public static void
fill(short[]
the array to be filled
a
,
short
the value to be stored in all elements of the array
val
)

Assigns the specified short value to each element of the specified array of shorts.

public static void
fill(short[]
the array to be filled
a
,
int
the index of the first element (inclusive) to be filled with the specified value
fromIndex
,
int
the index of the last element (exclusive) to be filled with the specified value
toIndex
,
short
the value to be stored in all elements of the array
val
)

Assigns the specified short value to each element of the specified range of the specified array of shorts.

public static void
fill(char[]
the array to be filled
a
,
char
the value to be stored in all elements of the array
val
)

Assigns the specified char value to each element of the specified array of chars.

public static void
fill(char[]
the array to be filled
a
,
int
the index of the first element (inclusive) to be filled with the specified value
fromIndex
,
int
the index of the last element (exclusive) to be filled with the specified value
toIndex
,
char
the value to be stored in all elements of the array
val
)

Assigns the specified char value to each element of the specified range of the specified array of chars.

public static void
fill(byte[]
the array to be filled
a
,
byte
the value to be stored in all elements of the array
val
)

Assigns the specified byte value to each element of the specified array of bytes.

public static void
fill(byte[]
the array to be filled
a
,
int
the index of the first element (inclusive) to be filled with the specified value
fromIndex
,
int
the index of the last element (exclusive) to be filled with the specified value
toIndex
,
byte
the value to be stored in all elements of the array
val
)

Assigns the specified byte value to each element of the specified range of the specified array of bytes.

public static void
fill(boolean[]
the array to be filled
a
,
boolean
the value to be stored in all elements of the array
val
)

Assigns the specified boolean value to each element of the specified array of booleans.

public static void
fill(boolean[]
the array to be filled
a
,
int
the index of the first element (inclusive) to be filled with the specified value
fromIndex
,
int
the index of the last element (exclusive) to be filled with the specified value
toIndex
,
boolean
the value to be stored in all elements of the array
val
)

Assigns the specified boolean value to each element of the specified range of the specified array of booleans.

public static void
fill(double[]
the array to be filled
a
,
double
the value to be stored in all elements of the array
val
)

Assigns the specified double value to each element of the specified array of doubles.

public static void
fill(double[]
the array to be filled
a
,
int
the index of the first element (inclusive) to be filled with the specified value
fromIndex
,
int
the index of the last element (exclusive) to be filled with the specified value
toIndex
,
double
the value to be stored in all elements of the array
val
)

Assigns the specified double value to each element of the specified range of the specified array of doubles.

public static void
fill(float[]
the array to be filled
a
,
float
the value to be stored in all elements of the array
val
)

Assigns the specified float value to each element of the specified array of floats.

public static void
fill(float[]
the array to be filled
a
,
int
the index of the first element (inclusive) to be filled with the specified value
fromIndex
,
int
the index of the last element (exclusive) to be filled with the specified value
toIndex
,
float
the value to be stored in all elements of the array
val
)

Assigns the specified float value to each element of the specified range of the specified array of floats.

public static void
fill(Object[]
the array to be filled
a
,
Object
the value to be stored in all elements of the array
val
)

Assigns the specified Object reference to each element of the specified array of Objects.

public static void
fill(Object[]
the array to be filled
a
,
int
the index of the first element (inclusive) to be filled with the specified value
fromIndex
,
int
the index of the last element (exclusive) to be filled with the specified value
toIndex
,
Object
the value to be stored in all elements of the array
val
)

Assigns the specified Object reference to each element of the specified range of the specified array of Objects.

public static int

Returns:

a content-based hash code for a
hashCode
(long[]
the array whose hash value to compute
a
)

Returns a hash code based on the contents of the specified array.

public static int

Returns:

a content-based hash code for a
hashCode
(int[]
the array whose hash value to compute
a
)

Returns a hash code based on the contents of the specified array.

public static int

Returns:

a content-based hash code for a
hashCode
(short[]
the array whose hash value to compute
a
)

Returns a hash code based on the contents of the specified array.

public static int

Returns:

a content-based hash code for a
hashCode
(char[]
the array whose hash value to compute
a
)

Returns a hash code based on the contents of the specified array.

public static int

Returns:

a content-based hash code for a
hashCode
(byte[]
the array whose hash value to compute
a
)

Returns a hash code based on the contents of the specified array.

public static int

Returns:

a content-based hash code for a
hashCode
(boolean[]
the array whose hash value to compute
a
)

Returns a hash code based on the contents of the specified array.

public static int

Returns:

a content-based hash code for a
hashCode
(float[]
the array whose hash value to compute
a
)

Returns a hash code based on the contents of the specified array.

public static int

Returns:

a content-based hash code for a
hashCode
(double[]
the array whose hash value to compute
a
)

Returns a hash code based on the contents of the specified array.

public static int

Returns:

a content-based hash code for a
hashCode
(Object[]
the array whose content-based hash code to compute
a
)

Returns a hash code based on the contents of the specified array.

private static void
legacyMergeSort(Object[] a)

To be removed in a future release.

private static void
legacyMergeSort(Object[] a, int fromIndex, int toIndex)

To be removed in a future release.

private static <T> void
legacyMergeSort(T[] a, Comparator<? super T> c)

To be removed in a future release.

private static <T> void
legacyMergeSort(T[] a, int fromIndex, int toIndex, Comparator<? super T> c)

To be removed in a future release.

private static void
mergeSort(Object[] src, Object[] dest, int low, int high, int off)

Src is the source array that starts at index 0 Dest is the (possibly larger) array destination with a possible offset low is the index in dest to start sorting high is the end index in dest to end sorting off is the offset to generate corresponding low, high in src To be removed in a future release.

private static void
mergeSort(Object[] src, Object[] dest, int low, int high, int off, Comparator<T> c)

Src is the source array that starts at index 0 Dest is the (possibly larger) array destination with a possible offset low is the index in dest to start sorting high is the end index in dest to end sorting off is the offset into src corresponding to low in dest To be removed in a future release.

public static int

Returns:

the index of the first mismatch between the two arrays, otherwise -1.
mismatch
(boolean[]
the first array to be tested for a mismatch
a
,
boolean[]
the second array to be tested for a mismatch
b
)

Finds and returns the index of the first mismatch between two boolean arrays, otherwise return -1 if no mismatch is found.

public static int

Returns:

the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
mismatch
(boolean[]
the first array to be tested for a mismatch
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
boolean[]
the second array to be tested for a mismatch
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Finds and returns the relative index of the first mismatch between two boolean arrays over the specified ranges, otherwise return -1 if no mismatch is found.

public static int

Returns:

the index of the first mismatch between the two arrays, otherwise -1.
mismatch
(byte[]
the first array to be tested for a mismatch
a
,
byte[]
the second array to be tested for a mismatch
b
)

Finds and returns the index of the first mismatch between two byte arrays, otherwise return -1 if no mismatch is found.

public static int

Returns:

the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
mismatch
(byte[]
the first array to be tested for a mismatch
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
byte[]
the second array to be tested for a mismatch
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Finds and returns the relative index of the first mismatch between two byte arrays over the specified ranges, otherwise return -1 if no mismatch is found.

public static int

Returns:

the index of the first mismatch between the two arrays, otherwise -1.
mismatch
(char[]
the first array to be tested for a mismatch
a
,
char[]
the second array to be tested for a mismatch
b
)

Finds and returns the index of the first mismatch between two char arrays, otherwise return -1 if no mismatch is found.

public static int

Returns:

the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
mismatch
(char[]
the first array to be tested for a mismatch
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
char[]
the second array to be tested for a mismatch
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Finds and returns the relative index of the first mismatch between two char arrays over the specified ranges, otherwise return -1 if no mismatch is found.

public static int

Returns:

the index of the first mismatch between the two arrays, otherwise -1.
mismatch
(short[]
the first array to be tested for a mismatch
a
,
short[]
the second array to be tested for a mismatch
b
)

Finds and returns the index of the first mismatch between two short arrays, otherwise return -1 if no mismatch is found.

public static int

Returns:

the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
mismatch
(short[]
the first array to be tested for a mismatch
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
short[]
the second array to be tested for a mismatch
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Finds and returns the relative index of the first mismatch between two short arrays over the specified ranges, otherwise return -1 if no mismatch is found.

public static int

Returns:

the index of the first mismatch between the two arrays, otherwise -1.
mismatch
(int[]
the first array to be tested for a mismatch
a
,
int[]
the second array to be tested for a mismatch
b
)

Finds and returns the index of the first mismatch between two int arrays, otherwise return -1 if no mismatch is found.

public static int

Returns:

the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
mismatch
(int[]
the first array to be tested for a mismatch
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
int[]
the second array to be tested for a mismatch
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Finds and returns the relative index of the first mismatch between two int arrays over the specified ranges, otherwise return -1 if no mismatch is found.

public static int

Returns:

the index of the first mismatch between the two arrays, otherwise -1.
mismatch
(long[]
the first array to be tested for a mismatch
a
,
long[]
the second array to be tested for a mismatch
b
)

Finds and returns the index of the first mismatch between two long arrays, otherwise return -1 if no mismatch is found.

public static int

Returns:

the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
mismatch
(long[]
the first array to be tested for a mismatch
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
long[]
the second array to be tested for a mismatch
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Finds and returns the relative index of the first mismatch between two long arrays over the specified ranges, otherwise return -1 if no mismatch is found.

public static int

Returns:

the index of the first mismatch between the two arrays, otherwise -1.
mismatch
(float[]
the first array to be tested for a mismatch
a
,
float[]
the second array to be tested for a mismatch
b
)

Finds and returns the index of the first mismatch between two float arrays, otherwise return -1 if no mismatch is found.

public static int

Returns:

the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
mismatch
(float[]
the first array to be tested for a mismatch
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
float[]
the second array to be tested for a mismatch
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Finds and returns the relative index of the first mismatch between two float arrays over the specified ranges, otherwise return -1 if no mismatch is found.

public static int

Returns:

the index of the first mismatch between the two arrays, otherwise -1.
mismatch
(double[]
the first array to be tested for a mismatch
a
,
double[]
the second array to be tested for a mismatch
b
)

Finds and returns the index of the first mismatch between two double arrays, otherwise return -1 if no mismatch is found.

public static int

Returns:

the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
mismatch
(double[]
the first array to be tested for a mismatch
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
double[]
the second array to be tested for a mismatch
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Finds and returns the relative index of the first mismatch between two double arrays over the specified ranges, otherwise return -1 if no mismatch is found.

public static int

Returns:

the index of the first mismatch between the two arrays, otherwise -1.
mismatch
(Object[]
the first array to be tested for a mismatch
a
,
Object[]
the second array to be tested for a mismatch
b
)

Finds and returns the index of the first mismatch between two Object arrays, otherwise return -1 if no mismatch is found.

public static int

Returns:

the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
mismatch
(Object[]
the first array to be tested for a mismatch
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
Object[]
the second array to be tested for a mismatch
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
)

Finds and returns the relative index of the first mismatch between two Object arrays over the specified ranges, otherwise return -1 if no mismatch is found.

public static <
the type of array elements
T
>
int

Returns:

the index of the first mismatch between the two arrays, otherwise -1.
mismatch
(T[]
the first array to be tested for a mismatch
a
,
T[]
the second array to be tested for a mismatch
b
,
Comparator<? super T>
the comparator to compare array elements
cmp
)

Finds and returns the index of the first mismatch between two Object arrays, otherwise return -1 if no mismatch is found.

public static <
the type of array elements
T
>
int

Returns:

the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
mismatch
(T[]
the first array to be tested for a mismatch
a
,
int
the index (inclusive) of the first element in the first array to be tested
aFromIndex
,
int
the index (exclusive) of the last element in the first array to be tested
aToIndex
,
T[]
the second array to be tested for a mismatch
b
,
int
the index (inclusive) of the first element in the second array to be tested
bFromIndex
,
int
the index (exclusive) of the last element in the second array to be tested
bToIndex
,
Comparator<? super T>
the comparator to compare array elements
cmp
)

Finds and returns the relative index of the first mismatch between two Object arrays over the specified ranges, otherwise return -1 if no mismatch is found.

public static <
the class of the objects in the array
T
>
void
parallelPrefix(T[]
the array, which is modified in-place by this method
array
,
BinaryOperator<T>
a side-effect-free, associative function to perform the cumulation
op
)

Cumulates, in parallel, each element of the given array in place, using the supplied function.

public static <
the class of the objects in the array
T
>
void
parallelPrefix(T[]
the array
array
,
int
the index of the first element, inclusive
fromIndex
,
int
the index of the last element, exclusive
toIndex
,
BinaryOperator<T>
a side-effect-free, associative function to perform the cumulation
op
)

Performs parallelPrefix(Object[], BinaryOperator) for the given subrange of the array.

public static void
parallelPrefix(long[]
the array, which is modified in-place by this method
array
,
LongBinaryOperator
a side-effect-free, associative function to perform the cumulation
op
)

Cumulates, in parallel, each element of the given array in place, using the supplied function.

public static void
parallelPrefix(long[]
the array
array
,
int
the index of the first element, inclusive
fromIndex
,
int
the index of the last element, exclusive
toIndex
,
LongBinaryOperator
a side-effect-free, associative function to perform the cumulation
op
)

Performs parallelPrefix(long[], LongBinaryOperator) for the given subrange of the array.

public static void
parallelPrefix(double[]
the array, which is modified in-place by this method
array
,
DoubleBinaryOperator
a side-effect-free function to perform the cumulation
op
)

Cumulates, in parallel, each element of the given array in place, using the supplied function.

public static void
parallelPrefix(double[]
the array
array
,
int
the index of the first element, inclusive
fromIndex
,
int
the index of the last element, exclusive
toIndex
,
DoubleBinaryOperator
a side-effect-free, associative function to perform the cumulation
op
)

Performs parallelPrefix(double[], DoubleBinaryOperator) for the given subrange of the array.

public static void
parallelPrefix(int[]
the array, which is modified in-place by this method
array
,
IntBinaryOperator
a side-effect-free, associative function to perform the cumulation
op
)

Cumulates, in parallel, each element of the given array in place, using the supplied function.

public static void
parallelPrefix(int[]
the array
array
,
int
the index of the first element, inclusive
fromIndex
,
int
the index of the last element, exclusive
toIndex
,
IntBinaryOperator
a side-effect-free, associative function to perform the cumulation
op
)

Performs parallelPrefix(int[], IntBinaryOperator) for the given subrange of the array.

public static <
type of elements of the array
T
>
void
parallelSetAll(T[]
array to be initialized
array
,
IntFunction<? extends T>
a function accepting an index and producing the desired value for that position
generator
)

Set all elements of the specified array, in parallel, using the provided generator function to compute each element.

public static void
parallelSetAll(int[]
array to be initialized
array
,
IntUnaryOperator
a function accepting an index and producing the desired value for that position
generator
)

Set all elements of the specified array, in parallel, using the provided generator function to compute each element.

public static void
parallelSetAll(long[]
array to be initialized
array
,
IntToLongFunction
a function accepting an index and producing the desired value for that position
generator
)

Set all elements of the specified array, in parallel, using the provided generator function to compute each element.

public static void
parallelSetAll(double[]
array to be initialized
array
,
IntToDoubleFunction
a function accepting an index and producing the desired value for that position
generator
)

Set all elements of the specified array, in parallel, using the provided generator function to compute each element.

public static void
parallelSort(byte[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
parallelSort(byte[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending numerical order.

public static void
parallelSort(char[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
parallelSort(char[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending numerical order.

public static void
parallelSort(short[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
parallelSort(short[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending numerical order.

public static void
parallelSort(int[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
parallelSort(int[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending numerical order.

public static void
parallelSort(long[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
parallelSort(long[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending numerical order.

public static void
parallelSort(float[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
parallelSort(float[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending numerical order.

public static void
parallelSort(double[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
parallelSort(double[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending numerical order.

public static <
the class of the objects to be sorted
T extends Comparable<? super T>
>
void
parallelSort(T[]
the array to be sorted
a
)

Sorts the specified array of objects into ascending order, according to the natural ordering of its elements.

public static <
the class of the objects to be sorted
T extends Comparable<? super T>
>
void
parallelSort(T[]
the array to be sorted
a
,
int
the index of the first element (inclusive) to be sorted
fromIndex
,
int
the index of the last element (exclusive) to be sorted
toIndex
)

Sorts the specified range of the specified array of objects into ascending order, according to the natural ordering of its elements.

public static <
the class of the objects to be sorted
T
>
void
parallelSort(T[]
the array to be sorted
a
,
Comparator<? super T>
the comparator to determine the order of the array. A null value indicates that the elements' natural ordering should be used.
cmp
)

Sorts the specified array of objects according to the order induced by the specified comparator.

public static <
the class of the objects to be sorted
T
>
void
parallelSort(T[]
the array to be sorted
a
,
int
the index of the first element (inclusive) to be sorted
fromIndex
,
int
the index of the last element (exclusive) to be sorted
toIndex
,
Comparator<? super T>
the comparator to determine the order of the array. A null value indicates that the elements' natural ordering should be used.
cmp
)

Sorts the specified range of the specified array of objects according to the order induced by the specified comparator.

private static int
pack-priv static void
rangeCheck(int arrayLength, int fromIndex, int toIndex)

Checks that fromIndex and toIndex are in the range and throws an exception if they aren't.

public static <
type of elements of the array
T
>
void
setAll(T[]
array to be initialized
array
,
IntFunction<? extends T>
a function accepting an index and producing the desired value for that position
generator
)

Set all elements of the specified array, using the provided generator function to compute each element.

public static void
setAll(int[]
array to be initialized
array
,
IntUnaryOperator
a function accepting an index and producing the desired value for that position
generator
)

Set all elements of the specified array, using the provided generator function to compute each element.

public static void
setAll(long[]
array to be initialized
array
,
IntToLongFunction
a function accepting an index and producing the desired value for that position
generator
)

Set all elements of the specified array, using the provided generator function to compute each element.

public static void
setAll(double[]
array to be initialized
array
,
IntToDoubleFunction
a function accepting an index and producing the desired value for that position
generator
)

Set all elements of the specified array, using the provided generator function to compute each element.

public static void
sort(int[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
sort(int[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending order.

public static void
sort(long[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
sort(long[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending order.

public static void
sort(short[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
sort(short[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending order.

public static void
sort(char[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
sort(char[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending order.

public static void
sort(byte[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
sort(byte[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending order.

public static void
sort(float[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
sort(float[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending order.

public static void
sort(double[]
the array to be sorted
a
)

Sorts the specified array into ascending numerical order.

public static void
sort(double[]
the array to be sorted
a
,
int
the index of the first element, inclusive, to be sorted
fromIndex
,
int
the index of the last element, exclusive, to be sorted
toIndex
)

Sorts the specified range of the array into ascending order.

public static void
sort(Object[]
the array to be sorted
a
)

Sorts the specified array of objects into ascending order, according to the natural ordering of its elements.

public static void
sort(Object[]
the array to be sorted
a
,
int
the index of the first element (inclusive) to be sorted
fromIndex
,
int
the index of the last element (exclusive) to be sorted
toIndex
)

Sorts the specified range of the specified array of objects into ascending order, according to the natural ordering of its elements.

public static <
the class of the objects to be sorted
T
>
void
sort(T[]
the array to be sorted
a
,
Comparator<? super T>
the comparator to determine the order of the array. A null value indicates that the elements' natural ordering should be used.
c
)

Sorts the specified array of objects according to the order induced by the specified comparator.

public static <
the class of the objects to be sorted
T
>
void
sort(T[]
the array to be sorted
a
,
int
the index of the first element (inclusive) to be sorted
fromIndex
,
int
the index of the last element (exclusive) to be sorted
toIndex
,
Comparator<? super T>
the comparator to determine the order of the array. A null value indicates that the elements' natural ordering should be used.
c
)

Sorts the specified range of the specified array of objects according to the order induced by the specified comparator.

public static <
type of elements
T
>
Spliterator<T>

Returns:

a spliterator for the array elements
spliterator
(T[]
the array, assumed to be unmodified during use
array
)

Returns a Spliterator covering all of the specified array.

public static <
type of elements
T
>
Spliterator<T>

Returns:

a spliterator for the array elements
spliterator
(T[]
the array, assumed to be unmodified during use
array
,
int
the first index to cover, inclusive
startInclusive
,
int
index immediately past the last index to cover
endExclusive
)

Returns a Spliterator covering the specified range of the specified array.

public static Spliterator.OfInt

Returns:

a spliterator for the array elements
spliterator
(int[]
the array, assumed to be unmodified during use
array
)

Returns a Spliterator.OfInt covering all of the specified array.

public static Spliterator.OfInt

Returns:

a spliterator for the array elements
spliterator
(int[]
the array, assumed to be unmodified during use
array
,
int
the first index to cover, inclusive
startInclusive
,
int
index immediately past the last index to cover
endExclusive
)

Returns a Spliterator.OfInt covering the specified range of the specified array.

public static Spliterator.OfLong

Returns:

the spliterator for the array elements
spliterator
(long[]
the array, assumed to be unmodified during use
array
)

Returns a Spliterator.OfLong covering all of the specified array.

public static Spliterator.OfLong

Returns:

a spliterator for the array elements
spliterator
(long[]
the array, assumed to be unmodified during use
array
,
int
the first index to cover, inclusive
startInclusive
,
int
index immediately past the last index to cover
endExclusive
)

Returns a Spliterator.OfLong covering the specified range of the specified array.

public static Spliterator.OfDouble

Returns:

a spliterator for the array elements
spliterator
(double[]
the array, assumed to be unmodified during use
array
)

Returns a Spliterator.OfDouble covering all of the specified array.

public static Spliterator.OfDouble

Returns:

a spliterator for the array elements
spliterator
(double[]
the array, assumed to be unmodified during use
array
,
int
the first index to cover, inclusive
startInclusive
,
int
index immediately past the last index to cover
endExclusive
)

Returns a Spliterator.OfDouble covering the specified range of the specified array.

public static <
The type of the array elements
T
>
Stream<T>

Returns:

a Stream for the array
stream
(T[]
The array, assumed to be unmodified during use
array
)

Returns a sequential Stream with the specified array as its source.

public static <
the type of the array elements
T
>
Stream<T>

Returns:

a Stream for the array range
stream
(T[]
the array, assumed to be unmodified during use
array
,
int
the first index to cover, inclusive
startInclusive
,
int
index immediately past the last index to cover
endExclusive
)

Returns a sequential Stream with the specified range of the specified array as its source.

public static IntStream

Returns:

an IntStream for the array
stream
(int[]
the array, assumed to be unmodified during use
array
)

Returns a sequential IntStream with the specified array as its source.

public static IntStream

Returns:

an IntStream for the array range
stream
(int[]
the array, assumed to be unmodified during use
array
,
int
the first index to cover, inclusive
startInclusive
,
int
index immediately past the last index to cover
endExclusive
)

Returns a sequential IntStream with the specified range of the specified array as its source.

public static LongStream

Returns:

a LongStream for the array
stream
(long[]
the array, assumed to be unmodified during use
array
)

Returns a sequential LongStream with the specified array as its source.

public static LongStream

Returns:

a LongStream for the array range
stream
(long[]
the array, assumed to be unmodified during use
array
,
int
the first index to cover, inclusive
startInclusive
,
int
index immediately past the last index to cover
endExclusive
)

Returns a sequential LongStream with the specified range of the specified array as its source.

public static DoubleStream

Returns:

a DoubleStream for the array
stream
(double[]
the array, assumed to be unmodified during use
array
)

Returns a sequential DoubleStream with the specified array as its source.

public static DoubleStream

Returns:

a DoubleStream for the array range
stream
(double[]
the array, assumed to be unmodified during use
array
,
int
the first index to cover, inclusive
startInclusive
,
int
index immediately past the last index to cover
endExclusive
)

Returns a sequential DoubleStream with the specified range of the specified array as its source.

private static void
swap(Object[] x, int a, int b)

Swaps x[a] with x[b].

public static String

Returns:

a string representation of a
toString
(long[]
the array whose string representation to return
a
)

Returns a string representation of the contents of the specified array.

public static String

Returns:

a string representation of a
toString
(int[]
the array whose string representation to return
a
)

Returns a string representation of the contents of the specified array.

public static String

Returns:

a string representation of a
toString
(short[]
the array whose string representation to return
a
)

Returns a string representation of the contents of the specified array.

public static String

Returns:

a string representation of a
toString
(char[]
the array whose string representation to return
a
)

Returns a string representation of the contents of the specified array.

public static String

Returns:

a string representation of a
toString
(byte[]
the array whose string representation to return
a
)

Returns a string representation of the contents of the specified array.

public static String

Returns:

a string representation of a
toString
(boolean[]
the array whose string representation to return
a
)

Returns a string representation of the contents of the specified array.

public static String

Returns:

a string representation of a
toString
(float[]
the array whose string representation to return
a
)

Returns a string representation of the contents of the specified array.

public static String

Returns:

a string representation of a
toString
(double[]
the array whose string representation to return
a
)

Returns a string representation of the contents of the specified array.

public static String

Returns:

a string representation of a
toString
(Object[]
the array whose string representation to return
a
)

Returns a string representation of the contents of the specified array.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait