| java.lang.Object | |
| ↳ | java.util.Arrays |
Arrays contains static methods which operate on arrays.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns a List on the objects in the specified array.
| |||||||||||
Performs a binary search for the specified element in the specified
sorted array.
| |||||||||||
Performs a binary search for the specified element in the specified
sorted array.
| |||||||||||
Performs a binary search for the specified element in the specified
sorted array.
| |||||||||||
Performs a binary search for the specified element in the specified
sorted array.
| |||||||||||
Performs a binary search for the specified element in the specified
sorted array.
| |||||||||||
Performs a binary search for the specified element in the specified
sorted array.
| |||||||||||
Performs a binary search for the specified element in the specified
sorted array using the Comparator to compare elements.
| |||||||||||
Performs a binary search for the specified element in the specified
sorted array.
| |||||||||||
Performs a binary search for the specified element in the specified
sorted array.
| |||||||||||
Returns true if the two given arrays are deeply equal to one another.
| |||||||||||
Returns a hash code based on the "deep contents" of the given array.
| |||||||||||
Creates a "deep" | |||||||||||
Compares the two arrays.
| |||||||||||
Compares the two arrays.
| |||||||||||
Compares the two arrays.
| |||||||||||
Compares the two arrays.
| |||||||||||
Compares the two arrays.
| |||||||||||
Compares the two arrays.
| |||||||||||
Compares the two arrays.
| |||||||||||
Compares the two arrays.
| |||||||||||
Compares the two arrays.
| |||||||||||
Fills the specified range in the array with the specified element.
| |||||||||||
Fills the specified array with the specified element.
| |||||||||||
Fills the specified range in the array with the specified element.
| |||||||||||
Fills the specified array with the specified element.
| |||||||||||
Fills the specified range in the array with the specified element.
| |||||||||||
Fills the specified range in the array with the specified element.
| |||||||||||
Fills the specified array with the specified element.
| |||||||||||
Fills the specified array with the specified element.
| |||||||||||
Fills the specified array with the specified element.
| |||||||||||
Fills the specified range in the array with the specified element.
| |||||||||||
Fills the specified array with the specified element.
| |||||||||||
Fills the specified range in the array with the specified element.
| |||||||||||
Fills the specified range in the array with the specified element.
| |||||||||||
Fills the specified array with the specified element.
| |||||||||||
Fills the specified range in the array with the specified element.
| |||||||||||
Fills the specified array with the specified element.
| |||||||||||
Fills the specified range in the array with the specified element.
| |||||||||||
Fills the specified array with the specified element.
| |||||||||||
Returns a hash code based on the contents of the given array.
| |||||||||||
Returns a hash code based on the contents of the given array.
| |||||||||||
Returns a hash code based on the contents of the given array.
| |||||||||||
Returns a hash code based on the contents of the given array.
| |||||||||||
Returns a hash code based on the contents of the given array.
| |||||||||||
Returns a hash code based on the contents of the given array.
| |||||||||||
Returns a hash code based on the contents of the given array.
| |||||||||||
Returns a hash code based on the contents of the given array.
| |||||||||||
Returns a hash code based on the contents of the given array.
| |||||||||||
Sorts the specified range in the array in ascending order.
| |||||||||||
Sorts the specified range in the array in ascending order.
| |||||||||||
Sorts the specified range in the array in ascending order.
| |||||||||||
Sorts the specified array in ascending order.
| |||||||||||
Sorts the specified array in ascending order.
| |||||||||||
Sorts the specified range in the array using the specified Comparator.
| |||||||||||
Sorts the specified range in the array in ascending order.
| |||||||||||
Sorts the specified array in ascending order.
| |||||||||||
Sorts the specified array in ascending order.
| |||||||||||
Sorts the specified range in the array in ascending order.
| |||||||||||
Sorts the specified array in ascending order.
| |||||||||||
Sorts the specified array in ascending order.
| |||||||||||
Sorts the specified range in the array in ascending order.
| |||||||||||
Sorts the specified array in ascending order.
| |||||||||||
Sorts the specified array using the specified Comparator.
| |||||||||||
Sorts the specified range in the array in ascending order.
| |||||||||||
Sorts the specified range in the array in ascending order.
| |||||||||||
Sorts the specified array in ascending order.
| |||||||||||
Creates a | |||||||||||
Creates a | |||||||||||
Creates a | |||||||||||
Creates a | |||||||||||
Creates a | |||||||||||
Creates a | |||||||||||
Creates a | |||||||||||
Creates a | |||||||||||
Creates a | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
Returns a List on the objects in the specified array. The size of the List cannot be modified, i.e. adding and removing are unsupported, but the elements can be set. Setting an element modifies the underlying array.
| array | the array |
|---|
Performs a binary search for the specified element in the specified sorted array.
| array | the sorted short array to search |
|---|---|
| value | the short element to find |
Performs a binary search for the specified element in the specified sorted array.
| array | the sorted long array to search |
|---|---|
| value | the long element to find |
Performs a binary search for the specified element in the specified sorted array.
| array | the sorted int array to search |
|---|---|
| value | the int element to find |
Performs a binary search for the specified element in the specified sorted array.
| array | the sorted char array to search |
|---|---|
| value | the char element to find |
Performs a binary search for the specified element in the specified sorted array.
| array | the sorted byte array to search |
|---|---|
| value | the byte element to find |
Performs a binary search for the specified element in the specified sorted array.
| array | the sorted double array to search |
|---|---|
| value | the double element to find |
Performs a binary search for the specified element in the specified sorted array using the Comparator to compare elements.
| array | the sorted char array to search |
|---|---|
| object | the char element to find |
| comparator | the Comparator |
| ClassCastException | when an element in the array and the search element cannot be compared to each other using the Comparator |
|---|
Performs a binary search for the specified element in the specified sorted array.
| array | the sorted float array to search |
|---|---|
| value | the float element to find |
Performs a binary search for the specified element in the specified sorted array.
| array | the sorted Object array to search |
|---|---|
| object | the Object element to find |
| ClassCastException | when an element in the array or the search element does not implement Comparable, or cannot be compared to each other |
|---|
Returns true if the two given arrays are deeply equal to one another. Unlike the method equals(Object[] array1, Object[] array2), this method is appropriate for use for nested arrays of arbitrary depth. Two array references are considered deeply equal if they are both null, or if they refer to arrays that have the same length and the elements at each index in the two arrays are equal. Two null elements element1 and element2 are possibly deeply equal if any of the following conditions satisfied: element1 and element2 are both arrays of object reference types, and Arrays.deepEquals(element1, element2) would return true. element1 and element2 are arrays of the same primitive type, and the appropriate overloading of Arrays.equals(element1, element2) would return true. element1 == element2 element1.equals(element2) would return true. Note that this definition permits null elements at any depth. If either of the given arrays contain themselves as elements, the behavior of this method is incertitude.
| array1 | the first Object array |
|---|---|
| array2 | the second Object array |
Returns a hash code based on the "deep contents" of the given array. If the array contains other arrays as its elements, the hash code is based on their contents not their identities. So It is not acceptable to invoke this method on an array that contains itself as an element, either directly or indirectly. For any two arrays a and b, if Arrays.deepEquals(a, b) returns true, it means that the return value of Arrays.deepHashCode(a) equals Arrays.deepHashCode(b). The computation of the value returned by this method is similar to that of the value returned by hashCode()} method invoked on a List} containing a sequence of instances representing the elements of array in the same order. The difference is: If an element e of array is itself an array, its hash code is computed by calling the appropriate overloading of Arrays.hashCode(e) if e is an array of a primitive type, or by calling Arrays.deepHashCode(e) recursively if e is an array of a reference type. The value returned by this method is the same value as the method Arrays.asList(array).hashCode(). If the array is null, the return value is 0.
| array | the array whose hash code to compute |
|---|
Creates a "deep" String representation of the
Object[] passed, such that if the array contains other
arrays, the String representation of those arrays is
generated as well.
If any of the elements are primitive arrays, the generation is delegated
to the other toString methods in this class. If any
element contains a reference to the original array, then it will be
represented as "[...]". If an element is an
Object[], then its representation is generated by a
recursive call to this method. All other elements are converted via the
valueOf(Object) method.
| array | The Object array to convert. |
|---|
String representation of array.Compares the two arrays.
| array1 | the first boolean array |
|---|---|
| array2 | the second boolean array |
Compares the two arrays. The values are compared in the same manner as Float.equals().
| array1 | the first float array |
|---|---|
| array2 | the second float array |
Compares the two arrays.
| array1 | the first long array |
|---|---|
| array2 | the second long array |
Compares the two arrays. The values are compared in the same manner as Double.equals().
| array1 | the first double array |
|---|---|
| array2 | the second double array |
Compares the two arrays.
| array1 | the first byte array |
|---|---|
| array2 | the second byte array |
Compares the two arrays.
| array1 | the first short array |
|---|---|
| array2 | the second short array |
Compares the two arrays.
| array1 | the first Object array |
|---|---|
| array2 | the second Object array |
Compares the two arrays.
| array1 | the first char array |
|---|---|
| array2 | the second char array |
Compares the two arrays.
| array1 | the first int array |
|---|---|
| array2 | the second int array |
Fills the specified range in the array with the specified element.
| array | the int array to fill |
|---|---|
| start | the first index to fill |
| end | the last + 1 index to fill |
| value | the int element |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Fills the specified array with the specified element.
| array | the short array to fill |
|---|---|
| value | the short element |
Fills the specified range in the array with the specified element.
| array | the boolean array to fill |
|---|---|
| start | the first index to fill |
| end | the last + 1 index to fill |
| value | the boolean element |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Fills the specified array with the specified element.
| array | the Object array to fill |
|---|---|
| value | the Object element |
Fills the specified range in the array with the specified element.
| array | the double array to fill |
|---|---|
| start | the first index to fill |
| end | the last + 1 index to fill |
| value | the double element |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Fills the specified range in the array with the specified element.
| array | the byte array to fill |
|---|---|
| start | the first index to fill |
| end | the last + 1 index to fill |
| value | the byte element |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Fills the specified array with the specified element.
| array | the long array to fill |
|---|---|
| value | the long element |
Fills the specified array with the specified element.
| array | the float array to fill |
|---|---|
| value | the float element |
Fills the specified array with the specified element.
| array | the boolean array to fill |
|---|---|
| value | the boolean element |
Fills the specified range in the array with the specified element.
| array | the short array to fill |
|---|---|
| start | the first index to fill |
| end | the last + 1 index to fill |
| value | the short element |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Fills the specified array with the specified element.
| array | the char array to fill |
|---|---|
| value | the char element |
Fills the specified range in the array with the specified element.
| array | the float array to fill |
|---|---|
| start | the first index to fill |
| end | the last + 1 index to fill |
| value | the float element |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Fills the specified range in the array with the specified element.
| array | the char array to fill |
|---|---|
| start | the first index to fill |
| end | the last + 1 index to fill |
| value | the char element |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Fills the specified array with the specified element.
| array | the int array to fill |
|---|---|
| value | the int element |
Fills the specified range in the array with the specified element.
| array | the Object array to fill |
|---|---|
| start | the first index to fill |
| end | the last + 1 index to fill |
| value | the Object element |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Fills the specified array with the specified element.
| array | the float array to fill |
|---|---|
| value | the float element |
Fills the specified range in the array with the specified element.
| array | the long array to fill |
|---|---|
| start | the first index to fill |
| end | the last + 1 index to fill |
| value | the long element |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Fills the specified array with the specified element.
| array | the byte array to fill |
|---|---|
| value | the byte element |
Returns a hash code based on the contents of the given array. For any two boolean arrays a and b, if Arrays.equals(a, b) returns true, it means that the return value of Arrays.hashCode(a) equals Arrays.hashCode(b). The value returned by this method is the same value as the hashCode()} method which is invoked on a List} containing a sequence of Boolean} instances representing the elements of array in the same order. If the array is null, the return value is 0.
| array | the array whose hash code to compute |
|---|
Returns a hash code based on the contents of the given array. If the array contains other arrays as its elements, the hash code is based on their identities not their contents. So it is acceptable to invoke this method on an array that contains itself as an element, either directly or indirectly. For any two arrays a and b, if Arrays.equals(a, b) returns true, it means that the return value of Arrays.hashCode(a) equals Arrays.hashCode(b). The value returned by this method is the same value as the method Arrays.asList(array).hashCode(). If the array is null, the return value is 0.
| array | the array whose hash code to compute |
|---|
Returns a hash code based on the contents of the given array. For any two double arrays a and b, if Arrays.equals(a, b) returns true, it means that the return value of Arrays.hashCode(a) equals Arrays.hashCode(b). The value returned by this method is the same value as the hashCode()} method which is invoked on a List} containing a sequence of Double} instances representing the elements of array in the same order. If the array is null, the return value is 0.
| array | the array whose hash code to compute |
|---|
Returns a hash code based on the contents of the given array. For any two not-null int arrays a and b, if Arrays.equals(a, b) returns true, it means that the return value of Arrays.hashCode(a) equals Arrays.hashCode(b). The value returned by this method is the same value as the hashCode()} method which is invoked on a List} containing a sequence of Integer} instances representing the elements of array in the same order. If the array is null, the return value is 0.
| array | the array whose hash code to compute |
|---|
Returns a hash code based on the contents of the given array. For any two char arrays a and b, if Arrays.equals(a, b) returns true, it means that the return value of Arrays.hashCode(a) equals Arrays.hashCode(b). The value returned by this method is the same value as the hashCode()} method which is invoked on a List} containing a sequence of Character} instances representing the elements of array in the same order. If the array is null, the return value is 0.
| array | the array whose hash code to compute |
|---|
Returns a hash code based on the contents of the given array. For any two long arrays a and b, if Arrays.equals(a, b) returns true, it means that the return value of Arrays.hashCode(a) equals Arrays.hashCode(b). The value returned by this method is the same value as the hashCode()} method which is invoked on a List} containing a sequence of Long} instances representing the elements of array in the same order. If the array is null, the return value is 0.
| array | the array whose hash code to compute |
|---|
Returns a hash code based on the contents of the given array. For any two float arrays a and b, if Arrays.equals(a, b) returns true, it means that the return value of Arrays.hashCode(a) equals Arrays.hashCode(b). The value returned by this method is the same value as the hashCode()} method which is invoked on a List} containing a sequence of Float} instances representing the elements of array in the same order. If the array is null, the return value is 0.
| array | the array whose hash code to compute |
|---|
Returns a hash code based on the contents of the given array. For any two byte arrays a and b, if Arrays.equals(a, b) returns true, it means that the return value of Arrays.hashCode(a) equals Arrays.hashCode(b). The value returned by this method is the same value as the hashCode()} method which is invoked on a List} containing a sequence of Byte} instances representing the elements of array in the same order. If the array is null, the return value is 0.
| array | the array whose hash code to compute |
|---|
Returns a hash code based on the contents of the given array. For any two short arrays a and b, if Arrays.equals(a, b) returns true, it means that the return value of Arrays.hashCode(a) equals Arrays.hashCode(b). The value returned by this method is the same value as the hashCode()} method which is invoked on a List} containing a sequence of Short} instances representing the elements of array in the same order. If the array is null, the return value is 0.
| array | the array whose hash code to compute |
|---|
Sorts the specified range in the array in ascending order.
| array | the long array to be sorted |
|---|---|
| start | the start index to sort |
| end | the last + 1 index to sort |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Sorts the specified range in the array in ascending order.
| array | the Object array to be sorted |
|---|---|
| start | the start index to sort |
| end | the last + 1 index to sort |
| ClassCastException | when an element in the array does not implement Comparable or elements cannot be compared to each other |
|---|---|
| IllegalArgumentException | when start > end |
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Sorts the specified range in the array in ascending order. The values are sorted according to the order imposed by Double.compareTo().
| array | the double array to be sorted |
|---|---|
| start | the start index to sort |
| end | the last + 1 index to sort |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size() |
Sorts the specified array in ascending order.
| array | the long array to be sorted |
|---|
Sorts the specified array in ascending order.
| array | the double array to be sorted |
|---|
Sorts the specified range in the array using the specified Comparator.
| array | the Object array to be sorted |
|---|---|
| start | the start index to sort |
| end | the last + 1 index to sort |
| comparator | the Comparator |
| ClassCastException | when elements in the array cannot be compared to each other using the Comparator |
|---|---|
| IllegalArgumentException | when start > end |
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Sorts the specified range in the array in ascending order.
| array | the char array to be sorted |
|---|---|
| start | the start index to sort |
| end | the last + 1 index to sort |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Sorts the specified array in ascending order.
| array | the char array to be sorted |
|---|
Sorts the specified array in ascending order.
| array | the Object array to be sorted |
|---|
| ClassCastException | when an element in the array does not implement Comparable or elements cannot be compared to each other |
|---|
Sorts the specified range in the array in ascending order.
| array | the byte array to be sorted |
|---|---|
| start | the start index to sort |
| end | the last + 1 index to sort |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Sorts the specified array in ascending order.
| array | the float array to be sorted |
|---|
Sorts the specified array in ascending order.
| array | the short array to be sorted |
|---|
Sorts the specified range in the array in ascending order.
| array | the int array to be sorted |
|---|---|
| start | the start index to sort |
| end | the last + 1 index to sort |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Sorts the specified array in ascending order.
| array | the byte array to be sorted |
|---|
Sorts the specified array using the specified Comparator.
| array | the Object array to be sorted |
|---|---|
| comparator | the Comparator |
| ClassCastException | when elements in the array cannot be compared to each other using the Comparator |
|---|
Sorts the specified range in the array in ascending order.
| array | the short array to be sorted |
|---|---|
| start | the start index to sort |
| end | the last + 1 index to sort |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size()
|
Sorts the specified range in the array in ascending order. The values are sorted according to the order imposed by Float.compareTo().
| array | the float array to be sorted |
|---|---|
| start | the start index to sort |
| end | the last + 1 index to sort |
| IllegalArgumentException | when start > end |
|---|---|
| ArrayIndexOutOfBoundsException | when start < 0 or
end > array.size() |
Sorts the specified array in ascending order.
| array | the int array to be sorted |
|---|
Creates a String representation of the
boolean[] passed. The result is surrounded by brackets ("[]"),
each element is converted to a String via the
valueOf(boolean) and separated by
", ". If the array is null,
then "null" is returned.
| array | The boolean array to convert. |
|---|
String representation of array.
Creates a String representation of the
double[] passed. The result is surrounded by brackets ("[]"),
each element is converted to a String via the
valueOf(double) and separated by
", ". If the array is null,
then "null" is returned.
| array | The double array to convert. |
|---|
String representation of array.
Creates a String representation of the byte[]
passed. The result is surrounded by brackets ("[]"),
each element is converted to a String via the
valueOf(int) and separated by ", ".
If the array is null, then "null"
is returned.
| array | The byte array to convert. |
|---|
String representation of array.
Creates a String representation of the
float[] passed. The result is surrounded by brackets ("[]"),
each element is converted to a String via the
valueOf(float) and separated by
", ". If the array is null,
then "null" is returned.
| array | The float array to convert. |
|---|
String representation of array.
Creates a String representation of the
short[] passed. The result is surrounded by brackets ("[]"),
each element is converted to a String via the
valueOf(int) and separated by
", ". If the array is null,
then "null" is returned.
| array | The short array to convert. |
|---|
String representation of array.
Creates a String representation of the long[]
passed. The result is surrounded by brackets ("[]"),
each element is converted to a String via the
valueOf(long) and separated by ", ".
If the array is null, then "null"
is returned.
| array | The long array to convert. |
|---|
String representation of array.
Creates a String representation of the int[]
passed. The result is surrounded by brackets ("[]"),
each element is converted to a String via the
valueOf(int) and separated by ", ".
If the array is null, then "null"
is returned.
| array | The int array to convert. |
|---|
String representation of array.
Creates a String representation of the char[]
passed. The result is surrounded by brackets ("[]"),
each element is converted to a String via the
valueOf(char) and separated by ", ".
If the array is null, then "null"
is returned.
| array | The char array to convert. |
|---|
String representation of array.
Creates a String representation of the
Object[] passed. The result is surrounded by brackets ("[]"),
each element is converted to a String via the
valueOf(Object) and separated by
", ". If the array is null,
then "null" is returned.
| array | The Object array to convert. |
|---|
String representation of array.