java.lang.Object | ||
java.util.Arrays |
Arrays contains static methods which operate on arrays.
static | <T> | List<T> | asList(T[] array) | |||
Returns a List on the objects in the specified array. | ||||||
static | int | binarySearch(short[] array, short value) | ||||
Performs a binary search for the specified element in the specified sorted array. | ||||||
static | int | binarySearch(long[] array, long value) | ||||
Performs a binary search for the specified element in the specified sorted array. | ||||||
static | int | binarySearch(int[] array, int value) | ||||
Performs a binary search for the specified element in the specified sorted array. | ||||||
static | int | binarySearch(char[] array, char value) | ||||
Performs a binary search for the specified element in the specified sorted array. | ||||||
static | int | binarySearch(byte[] array, byte value) | ||||
Performs a binary search for the specified element in the specified sorted array. | ||||||
static | int | binarySearch(double[] array, double value) | ||||
Performs a binary search for the specified element in the specified sorted array. | ||||||
static | <T> | int | binarySearch(T[] array, T object, Comparator<? super T> comparator) | |||
Performs a binary search for the specified element in the specified sorted array using the Comparator to compare elements. | ||||||
static | int | binarySearch(float[] array, float value) | ||||
Performs a binary search for the specified element in the specified sorted array. | ||||||
static | int | binarySearch(Object[] array, Object object) | ||||
Performs a binary search for the specified element in the specified sorted array. | ||||||
static | boolean | deepEquals(Object[] array1, Object[] array2) | ||||
Returns true if the two given arrays are deeply equal to one another. | ||||||
static | int | deepHashCode(Object[] array) | ||||
Returns a hash code based on the "deep contents" of the given array. | ||||||
static | String | deepToString(Object[] array) | ||||
Creates a "deep" |
||||||
static | boolean | equals(boolean[] array1, boolean[] array2) | ||||
Compares the two arrays. | ||||||
static | boolean | equals(float[] array1, float[] array2) | ||||
Compares the two arrays. | ||||||
static | boolean | equals(long[] array1, long[] array2) | ||||
Compares the two arrays. | ||||||
static | boolean | equals(double[] array1, double[] array2) | ||||
Compares the two arrays. | ||||||
static | boolean | equals(byte[] array1, byte[] array2) | ||||
Compares the two arrays. | ||||||
static | boolean | equals(short[] array1, short[] array2) | ||||
Compares the two arrays. | ||||||
static | boolean | equals(Object[] array1, Object[] array2) | ||||
Compares the two arrays. | ||||||
static | boolean | equals(char[] array1, char[] array2) | ||||
Compares the two arrays. | ||||||
static | boolean | equals(int[] array1, int[] array2) | ||||
Compares the two arrays. | ||||||
static | void | fill(int[] array, int start, int end, int value) | ||||
Fills the specified range in the array with the specified element. | ||||||
static | void | fill(short[] array, short value) | ||||
Fills the specified array with the specified element. | ||||||
static | void | fill(boolean[] array, int start, int end, boolean value) | ||||
Fills the specified range in the array with the specified element. | ||||||
static | void | fill(Object[] array, Object value) | ||||
Fills the specified array with the specified element. | ||||||
static | void | fill(double[] array, int start, int end, double value) | ||||
Fills the specified range in the array with the specified element. | ||||||
static | void | fill(byte[] array, int start, int end, byte value) | ||||
Fills the specified range in the array with the specified element. | ||||||
static | void | fill(long[] array, long value) | ||||
Fills the specified array with the specified element. | ||||||
static | void | fill(float[] array, float value) | ||||
Fills the specified array with the specified element. | ||||||
static | void | fill(boolean[] array, boolean value) | ||||
Fills the specified array with the specified element. | ||||||
static | void | fill(short[] array, int start, int end, short value) | ||||
Fills the specified range in the array with the specified element. | ||||||
static | void | fill(char[] array, char value) | ||||
Fills the specified array with the specified element. | ||||||
static | void | fill(float[] array, int start, int end, float value) | ||||
Fills the specified range in the array with the specified element. | ||||||
static | void | fill(char[] array, int start, int end, char value) | ||||
Fills the specified range in the array with the specified element. | ||||||
static | void | fill(int[] array, int value) | ||||
Fills the specified array with the specified element. | ||||||
static | void | fill(Object[] array, int start, int end, Object value) | ||||
Fills the specified range in the array with the specified element. | ||||||
static | void | fill(double[] array, double value) | ||||
Fills the specified array with the specified element. | ||||||
static | void | fill(long[] array, int start, int end, long value) | ||||
Fills the specified range in the array with the specified element. | ||||||
static | void | fill(byte[] array, byte value) | ||||
Fills the specified array with the specified element. | ||||||
static | int | hashCode(boolean[] array) | ||||
Returns a hash code based on the contents of the given array. | ||||||
static | int | hashCode(Object[] array) | ||||
Returns a hash code based on the contents of the given array. | ||||||
static | int | hashCode(double[] array) | ||||
Returns a hash code based on the contents of the given array. | ||||||
static | int | hashCode(int[] array) | ||||
Returns a hash code based on the contents of the given array. | ||||||
static | int | hashCode(char[] array) | ||||
Returns a hash code based on the contents of the given array. | ||||||
static | int | hashCode(long[] array) | ||||
Returns a hash code based on the contents of the given array. | ||||||
static | int | hashCode(float[] array) | ||||
Returns a hash code based on the contents of the given array. | ||||||
static | int | hashCode(byte[] array) | ||||
Returns a hash code based on the contents of the given array. | ||||||
static | int | hashCode(short[] array) | ||||
Returns a hash code based on the contents of the given array. | ||||||
static | void | sort(long[] array, int start, int end) | ||||
Sorts the specified range in the array in ascending order. | ||||||
static | void | sort(Object[] array, int start, int end) | ||||
Sorts the specified range in the array in ascending order. | ||||||
static | void | sort(double[] array, int start, int end) | ||||
Sorts the specified range in the array in ascending order. | ||||||
static | void | sort(long[] array) | ||||
Sorts the specified array in ascending order. | ||||||
static | void | sort(double[] array) | ||||
Sorts the specified array in ascending order. | ||||||
static | <T> | void | sort(T[] array, int start, int end, Comparator<? super T> comparator) | |||
Sorts the specified range in the array using the specified Comparator. | ||||||
static | void | sort(char[] array, int start, int end) | ||||
Sorts the specified range in the array in ascending order. | ||||||
static | void | sort(char[] array) | ||||
Sorts the specified array in ascending order. | ||||||
static | void | sort(Object[] array) | ||||
Sorts the specified array in ascending order. | ||||||
static | void | sort(byte[] array, int start, int end) | ||||
Sorts the specified range in the array in ascending order. | ||||||
static | void | sort(float[] array) | ||||
Sorts the specified array in ascending order. | ||||||
static | void | sort(short[] array) | ||||
Sorts the specified array in ascending order. | ||||||
static | void | sort(int[] array, int start, int end) | ||||
Sorts the specified range in the array in ascending order. | ||||||
static | void | sort(byte[] array) | ||||
Sorts the specified array in ascending order. | ||||||
static | <T> | void | sort(T[] array, Comparator<? super T> comparator) | |||
Sorts the specified array using the specified Comparator. | ||||||
static | void | sort(short[] array, int start, int end) | ||||
Sorts the specified range in the array in ascending order. | ||||||
static | void | sort(float[] array, int start, int end) | ||||
Sorts the specified range in the array in ascending order. | ||||||
static | void | sort(int[] array) | ||||
Sorts the specified array in ascending order. | ||||||
static | String | toString(boolean[] array) | ||||
Creates a |
||||||
static | String | toString(double[] array) | ||||
Creates a |
||||||
static | String | toString(byte[] array) | ||||
Creates a |
||||||
static | String | toString(float[] array) | ||||
Creates a |
||||||
static | String | toString(short[] array) | ||||
Creates a |
||||||
static | String | toString(long[] array) | ||||
Creates a |
||||||
static | String | toString(int[] array) | ||||
Creates a |
||||||
static | String | toString(char[] array) | ||||
Creates a |
||||||
static | String | toString(Object[] array) | ||||
Creates a |
array | the array |
---|
array | the sorted short array to search |
---|---|
value | the short element to find |
array | the sorted long array to search |
---|---|
value | the long element to find |
array | the sorted int array to search |
---|---|
value | the int element to find |
array | the sorted char array to search |
---|---|
value | the char element to find |
array | the sorted byte array to search |
---|---|
value | the byte element to find |
array | the sorted double array to search |
---|---|
value | the double element to find |
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 |
---|
array | the sorted float array to search |
---|---|
value | the float element to find |
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 |
---|
array1 | the first Object array |
---|---|
array2 | the second Object array |
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
.array1 | the first boolean array |
---|---|
array2 | the second boolean array |
array1 | the first float array |
---|---|
array2 | the second float array |
array1 | the first long array |
---|---|
array2 | the second long array |
array1 | the first double array |
---|---|
array2 | the second double array |
array1 | the first byte array |
---|---|
array2 | the second byte array |
array1 | the first short array |
---|---|
array2 | the second short array |
array1 | the first Object array |
---|---|
array2 | the second Object array |
array1 | the first char array |
---|---|
array2 | the second char array |
array1 | the first int array |
---|---|
array2 | the second int array |
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()
|
array | the short array to fill |
---|---|
value | the short 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()
|
array | the Object array to fill |
---|---|
value | the Object 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()
|
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()
|
array | the long array to fill |
---|---|
value | the long element |
array | the float array to fill |
---|---|
value | the float element |
array | the boolean array to fill |
---|---|
value | the boolean 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()
|
array | the char array to fill |
---|---|
value | the char 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()
|
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()
|
array | the int array to fill |
---|---|
value | the int 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()
|
array | the float array to fill |
---|---|
value | the float 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()
|
array | the byte array to fill |
---|---|
value | the byte element |
array | the array whose hash code to compute |
---|
array | the array whose hash code to compute |
---|
array | the array whose hash code to compute |
---|
array | the array whose hash code to compute |
---|
array | the array whose hash code to compute |
---|
array | the array whose hash code to compute |
---|
array | the array whose hash code to compute |
---|
array | the array whose hash code to compute |
---|
array | the array whose hash code to compute |
---|
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()
|
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()
|
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() |
array | the long array to be sorted |
---|
array | the double array to be sorted |
---|
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()
|
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()
|
array | the char array to be sorted |
---|
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 |
---|
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()
|
array | the float array to be sorted |
---|
array | the short array to be sorted |
---|
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()
|
array | the byte array to be sorted |
---|
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 |
---|
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()
|
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() |
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
.Copyright 2007 Google Inc. | Build 0.9_r1-98467 - 14 Aug 2008 18:48 |