| java.lang.Object | |
| ↳ | java.lang.reflect.Array |
This class provides methods to dynamically create and access arrays.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Return the element of the array at the specified index.
| |||||||||||
Return the element of the array at the specified index, converted to a
boolean if possible.
| |||||||||||
Return the element of the array at the specified index, converted to a
byte if possible.
| |||||||||||
Return the element of the array at the specified index, converted to a
char if possible.
| |||||||||||
Return the element of the array at the specified index, converted to a
double if possible.
| |||||||||||
Return the element of the array at the specified index, converted to a
float if possible.
| |||||||||||
Return the element of the array at the specified index, converted to an
int if possible.
| |||||||||||
Return the length of the array.
| |||||||||||
Return the element of the array at the specified index, converted to a
long if possible.
| |||||||||||
Return the element of the array at the specified index, converted to a
short if possible.
| |||||||||||
Return a new multidimensional array of the specified component type and
dimensions.
| |||||||||||
Return a new array of the specified component type and length.
| |||||||||||
Set the element of the array at the specified index to the value.
| |||||||||||
Set the element of the array at the specified index to the boolean value.
| |||||||||||
Set the element of the array at the specified index to the byte value.
| |||||||||||
Set the element of the array at the specified index to the char value.
| |||||||||||
Set the element of the array at the specified index to the double value.
| |||||||||||
Set the element of the array at the specified index to the float value.
| |||||||||||
Set the element of the array at the specified index to the int value.
| |||||||||||
Set the element of the array at the specified index to the long value.
| |||||||||||
Set the element of the array at the specified index to the short value.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
Return the element of the array at the specified index. This reproduces
the effect of array[index] If the array component is a
base type, the result is automatically wrapped.
| array | the array |
|---|---|
| index | the index |
| NullPointerException | if the array is null |
|---|---|
| IllegalArgumentException | if the array is not an array |
| ArrayIndexOutOfBoundsException | if the index is out of bounds -- negative or greater than or equal to the array length |
Return the element of the array at the specified index, converted to a
boolean if possible. This reproduces the effect of
array[index]
| array | the array |
|---|---|
| index | the index |
| NullPointerException | if the array is null |
|---|---|
| IllegalArgumentException | if the array is not an array or the element cannot be converted to the requested type by a widening conversion |
| ArrayIndexOutOfBoundsException | if the index is out of bounds -- negative or greater than or equal to the array length |
Return the element of the array at the specified index, converted to a
byte if possible. This reproduces the effect of array[index]
| array | the array |
|---|---|
| index | the index |
| NullPointerException | if the array is null |
|---|---|
| IllegalArgumentException | if the array is not an array or the element cannot be converted to the requested type by a widening conversion |
| ArrayIndexOutOfBoundsException | if the index is out of bounds -- negative or greater than or equal to the array length |
Return the element of the array at the specified index, converted to a
char if possible. This reproduces the effect of array[index]
| array | the array |
|---|---|
| index | the index |
| NullPointerException | if the array is null |
|---|---|
| IllegalArgumentException | if the array is not an array or the element cannot be converted to the requested type by a widening conversion |
| ArrayIndexOutOfBoundsException | if the index is out of bounds -- negative or greater than or equal to the array length |
Return the element of the array at the specified index, converted to a
double if possible. This reproduces the effect of
array[index]
| array | the array |
|---|---|
| index | the index |
| NullPointerException | if the array is null |
|---|---|
| IllegalArgumentException | if the array is not an array or the element cannot be converted to the requested type by a widening conversion |
| ArrayIndexOutOfBoundsException | if the index is out of bounds -- negative or greater than or equal to the array length |
Return the element of the array at the specified index, converted to a
float if possible. This reproduces the effect of
array[index]
| array | the array |
|---|---|
| index | the index |
| NullPointerException | if the array is null |
|---|---|
| IllegalArgumentException | if the array is not an array or the element cannot be converted to the requested type by a widening conversion |
| ArrayIndexOutOfBoundsException | if the index is out of bounds -- negative or greater than or equal to the array length |
Return the element of the array at the specified index, converted to an
int if possible. This reproduces the effect of array[index]
| array | the array |
|---|---|
| index | the index |
| NullPointerException | if the array is null |
|---|---|
| IllegalArgumentException | if the array is not an array or the element cannot be converted to the requested type by a widening conversion |
| ArrayIndexOutOfBoundsException | if the index is out of bounds -- negative or greater than or equal to the array length |
Return the length of the array. This reproduces the effect of
array.length
| array | the array |
|---|
| NullPointerException | if the array is null |
|---|---|
| IllegalArgumentException | if the array is not an array |
Return the element of the array at the specified index, converted to a
long if possible. This reproduces the effect of array[index]
| array | the array |
|---|---|
| index | the index |
| NullPointerException | if the array is null |
|---|---|
| IllegalArgumentException | if the array is not an array or the element cannot be converted to the requested type by a widening conversion |
| ArrayIndexOutOfBoundsException | if the index is out of bounds -- negative or greater than or equal to the array length |
Return the element of the array at the specified index, converted to a
short if possible. This reproduces the effect of
array[index]
| array | the array |
|---|---|
| index | the index |
| NullPointerException | if the array is null |
|---|---|
| IllegalArgumentException | if the array is not an array or the element cannot be converted to the requested type by a widening conversion |
| ArrayIndexOutOfBoundsException | if the index is out of bounds -- negative or greater than or equal to the array length |
Return a new multidimensional array of the specified component type and
dimensions. This reproduces the effect of
new componentType[d0][d1]...[dn] for a dimensions array of {
d0, d1, ... , dn }
| componentType | the component type of the new array |
|---|---|
| dimensions | the dimensions of the new array |
| NullPointerException | if the component type is 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) |
Return a new array of the specified component type and length. This
reproduces the effect of new componentType[size]
| componentType | the component type of the new array |
|---|---|
| size | the length of the new array |
| NullPointerException | if the component type is null |
|---|---|
| NegativeArraySizeException | if the size if negative |
Set the element of the array at the specified index to the value. This
reproduces the effect of array[index] = value If the array
component is a base type, the value is automatically unwrapped
| array | the array |
|---|---|
| index | the index |
| value | the new value |
| NullPointerException | if the array is 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 the index is out of bounds -- negative or greater than or equal to the array length |
Set the element of the array at the specified index to the boolean value.
This reproduces the effect of array[index] = value
| array | the array |
|---|---|
| index | the index |
| value | the new value |
| NullPointerException | if the array is 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 the index is out of bounds -- negative or greater than or equal to the array length |
Set the element of the array at the specified index to the byte value.
This reproduces the effect of array[index] = value
| array | the array |
|---|---|
| index | the index |
| value | the new value |
| NullPointerException | if the array is 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 the index is out of bounds -- negative or greater than or equal to the array length |
Set the element of the array at the specified index to the char value.
This reproduces the effect of array[index] = value
| array | the array |
|---|---|
| index | the index |
| value | the new value |
| NullPointerException | if the array is 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 the index is out of bounds -- negative or greater than or equal to the array length |
Set the element of the array at the specified index to the double value.
This reproduces the effect of array[index] = value
| array | the array |
|---|---|
| index | the index |
| value | the new value |
| NullPointerException | if the array is 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 the index is out of bounds -- negative or greater than or equal to the array length |
Set the element of the array at the specified index to the float value.
This reproduces the effect of array[index] = value
| array | the array |
|---|---|
| index | the index |
| value | the new value |
| NullPointerException | if the array is 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 the index is out of bounds -- negative or greater than or equal to the array length |
Set the element of the array at the specified index to the int value.
This reproduces the effect of array[index] = value
| array | the array |
|---|---|
| index | the index |
| value | the new value |
| NullPointerException | if the array is 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 the index is out of bounds -- negative or greater than or equal to the array length |
Set the element of the array at the specified index to the long value.
This reproduces the effect of array[index] = value
| array | the array |
|---|---|
| index | the index |
| value | the new value |
| NullPointerException | if the array is 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 the index is out of bounds -- negative or greater than or equal to the array length |
Set the element of the array at the specified index to the short value.
This reproduces the effect of array[index] = value
| array | the array |
|---|---|
| index | the index |
| value | the new value |
| NullPointerException | if the array is 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 the index is out of bounds -- negative or greater than or equal to the array length |