java.lang.Object | |
↳ | java.lang.reflect.Array |
Provides static methods to create and access arrays dynamically.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the element of the array at the specified index.
| |||||||||||
Returns the boolean at the given index in the given boolean array.
| |||||||||||
Returns the byte at the given index in the given byte array.
| |||||||||||
Returns the char at the given index in the given char array.
| |||||||||||
Returns the double at the given index in the given array.
| |||||||||||
Returns the float at the given index in the given array.
| |||||||||||
Returns the int at the given index in the given array.
| |||||||||||
Returns the length of the array.
| |||||||||||
Returns the long at the given index in the given array.
| |||||||||||
Returns the short at the given index in the given array.
| |||||||||||
Returns a new array of the specified component type and length.
| |||||||||||
Returns a new multidimensional array of the specified component type and
dimensions.
| |||||||||||
Sets the element of the array at the specified index to the value.
| |||||||||||
Sets
array[index] = value . | |||||||||||
Sets
array[index] = value . | |||||||||||
Sets
array[index] = value . | |||||||||||
Sets
array[index] = value . | |||||||||||
Sets
array[index] = value . | |||||||||||
Sets
array[index] = value . | |||||||||||
Sets
array[index] = value . | |||||||||||
Sets
array[index] = value . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Returns the element of the array at the specified index. Equivalent to array[index]
.
If the array component is a primitive type, the result is automatically boxed.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if array is not an array |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Returns the boolean at the given index in the given boolean array.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if array is not an array or the element at the
index position can not be converted to the return type |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Returns the byte at the given index in the given byte array.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if array is not an array or the element at the
index position can not be converted to the return type |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Returns the char at the given index in the given char array.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if array is not an array or the element at the
index position can not be converted to the return type |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Returns the double at the given index in the given array. Applies to byte, char, float, double, int, long, and short arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if array is not an array or the element at the
index position can not be converted to the return type |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Returns the float at the given index in the given array. Applies to byte, char, float, int, long, and short arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if array is not an array or the element at the
index position can not be converted to the return type |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Returns the int at the given index in the given array. Applies to byte, char, int, and short arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if array is not an array or the element at the
index position can not be converted to the return type |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Returns the length of the array. Equivalent to array.length
.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if array is not an array
|
Returns the long at the given index in the given array. Applies to byte, char, int, long, and short arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if array is not an array or the element at the
index position can not be converted to the return type |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Returns the short at the given index in the given array. Applies to byte and short arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if array is not an array or the element at the
index position can not be converted to the return type |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Returns a new array of the specified component type and length.
Equivalent to new componentType[size]
.
NullPointerException | if the component type is null |
---|---|
NegativeArraySizeException | if size < 0
|
Returns a new multidimensional array of the specified component type and
dimensions. Equivalent to new componentType[d0][d1]...[dn]
for a
dimensions array of { d0, d1, ... , dn }.
NullPointerException | if array == null |
---|---|
NegativeArraySizeException | if any of the dimensions are negative |
IllegalArgumentException | if the array of dimensions is of size zero, or exceeds the limit of the number of dimension for an array (currently 255) |
Sets the element of the array at the specified index to the value.
Equivalent to array[index] = value
. If the array
component is a primitive type, the value is automatically unboxed.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if array is not an array or the value cannot be
converted to the array type by a widening conversion |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Sets array[index] = value
. Applies to boolean arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if the array is not an array or the value cannot be
converted to the array type by a widening conversion |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Sets array[index] = value
. Applies to byte, double, float, int, long, and short arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if the array is not an array or the value cannot be
converted to the array type by a widening conversion |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Sets array[index] = value
. Applies to char, double, float, int, and long arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if the array is not an array or the value cannot be
converted to the array type by a widening conversion |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Sets array[index] = value
. Applies to double arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if the array is not an array or the value cannot be
converted to the array type by a widening conversion |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Sets array[index] = value
. Applies to double and float arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if the array is not an array or the value cannot be
converted to the array type by a widening conversion |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Sets array[index] = value
. Applies to double, float, int, and long arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if the array is not an array or the value cannot be
converted to the array type by a widening conversion |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Sets array[index] = value
. Applies to double, float, and long arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if the array is not an array or the value cannot be
converted to the array type by a widening conversion |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|
Sets array[index] = value
. Applies to double, float, int, long, and short arrays.
NullPointerException | if array == null |
---|---|
IllegalArgumentException | if the array is not an array or the value cannot be
converted to the array type by a widening conversion |
ArrayIndexOutOfBoundsException | if index < 0 || index >= array.length
|