1 *java.lang.reflect.Array* *Array* The Array class provides static methods to dyn
3 public final class Array
4 extends |java.lang.Object|
6 |java.lang.reflect.Array_Description|
7 |java.lang.reflect.Array_Fields|
8 |java.lang.reflect.Array_Constructors|
9 |java.lang.reflect.Array_Methods|
11 ================================================================================
13 *java.lang.reflect.Array_Methods*
14 |java.lang.reflect.Array.get(Object,int)|Returns the value of the indexed compo
15 |java.lang.reflect.Array.getBoolean(Object,int)|Returns the value of the indexe
16 |java.lang.reflect.Array.getByte(Object,int)|Returns the value of the indexed c
17 |java.lang.reflect.Array.getChar(Object,int)|Returns the value of the indexed c
18 |java.lang.reflect.Array.getDouble(Object,int)|Returns the value of the indexed
19 |java.lang.reflect.Array.getFloat(Object,int)|Returns the value of the indexed
20 |java.lang.reflect.Array.getInt(Object,int)|Returns the value of the indexed co
21 |java.lang.reflect.Array.getLength(Object)|Returns the length of the specified
22 |java.lang.reflect.Array.getLong(Object,int)|Returns the value of the indexed c
23 |java.lang.reflect.Array.getShort(Object,int)|Returns the value of the indexed
24 |java.lang.reflect.Array.newInstance(Class<?>,int...)|Creates a new array with
25 |java.lang.reflect.Array.newInstance(Class<?>,int)|Creates a new array with the
26 |java.lang.reflect.Array.set(Object,int,Object)|Sets the value of the indexed c
27 |java.lang.reflect.Array.setBoolean(Object,int,boolean)|Sets the value of the i
28 |java.lang.reflect.Array.setByte(Object,int,byte)|Sets the value of the indexed
29 |java.lang.reflect.Array.setChar(Object,int,char)|Sets the value of the indexed
30 |java.lang.reflect.Array.setDouble(Object,int,double)|Sets the value of the ind
31 |java.lang.reflect.Array.setFloat(Object,int,float)|Sets the value of the index
32 |java.lang.reflect.Array.setInt(Object,int,int)|Sets the value of the indexed c
33 |java.lang.reflect.Array.setLong(Object,int,long)|Sets the value of the indexed
34 |java.lang.reflect.Array.setShort(Object,int,short)|Sets the value of the index
36 *java.lang.reflect.Array_Description*
38 The Array class provides static methods to dynamically create and access Java
41 Array permits widening conversions to occur during a get or set operation, but
42 throws an IllegalArgumentException if a narrowing conversion would occur.
46 *java.lang.reflect.Array.get(Object,int)*
48 public static native |java.lang.Object| get(
49 java.lang.Object array,
51 throws |java.lang.ArrayIndexOutOfBoundsException|
52 |java.lang.IllegalArgumentException|
54 Returns the value of the indexed component in the specified array object. The
55 value is automatically wrapped in an object if it has a primitive type.
61 Returns: the (possibly wrapped) value of the indexed component in the specified array
63 *java.lang.reflect.Array.getBoolean(Object,int)*
65 public static native boolean getBoolean(
66 java.lang.Object array,
68 throws |java.lang.ArrayIndexOutOfBoundsException|
69 |java.lang.IllegalArgumentException|
71 Returns the value of the indexed component in the specified array object, as a
78 Returns: the value of the indexed component in the specified array
80 *java.lang.reflect.Array.getByte(Object,int)*
82 public static native byte getByte(
83 java.lang.Object array,
85 throws |java.lang.ArrayIndexOutOfBoundsException|
86 |java.lang.IllegalArgumentException|
88 Returns the value of the indexed component in the specified array object, as a
95 Returns: the value of the indexed component in the specified array
97 *java.lang.reflect.Array.getChar(Object,int)*
99 public static native char getChar(
100 java.lang.Object array,
102 throws |java.lang.ArrayIndexOutOfBoundsException|
103 |java.lang.IllegalArgumentException|
105 Returns the value of the indexed component in the specified array object, as a
112 Returns: the value of the indexed component in the specified array
114 *java.lang.reflect.Array.getDouble(Object,int)*
116 public static native double getDouble(
117 java.lang.Object array,
119 throws |java.lang.ArrayIndexOutOfBoundsException|
120 |java.lang.IllegalArgumentException|
122 Returns the value of the indexed component in the specified array object, as a
129 Returns: the value of the indexed component in the specified array
131 *java.lang.reflect.Array.getFloat(Object,int)*
133 public static native float getFloat(
134 java.lang.Object array,
136 throws |java.lang.ArrayIndexOutOfBoundsException|
137 |java.lang.IllegalArgumentException|
139 Returns the value of the indexed component in the specified array object, as a
146 Returns: the value of the indexed component in the specified array
148 *java.lang.reflect.Array.getInt(Object,int)*
150 public static native int getInt(
151 java.lang.Object array,
153 throws |java.lang.ArrayIndexOutOfBoundsException|
154 |java.lang.IllegalArgumentException|
156 Returns the value of the indexed component in the specified array object, as an
163 Returns: the value of the indexed component in the specified array
165 *java.lang.reflect.Array.getLength(Object)*
167 public static native int getLength(java.lang.Object array)
168 throws |java.lang.IllegalArgumentException|
170 Returns the length of the specified array object, as an int.
175 Returns: the length of the array
177 *java.lang.reflect.Array.getLong(Object,int)*
179 public static native long getLong(
180 java.lang.Object array,
182 throws |java.lang.ArrayIndexOutOfBoundsException|
183 |java.lang.IllegalArgumentException|
185 Returns the value of the indexed component in the specified array object, as a
192 Returns: the value of the indexed component in the specified array
194 *java.lang.reflect.Array.getShort(Object,int)*
196 public static native short getShort(
197 java.lang.Object array,
199 throws |java.lang.ArrayIndexOutOfBoundsException|
200 |java.lang.IllegalArgumentException|
202 Returns the value of the indexed component in the specified array object, as a
209 Returns: the value of the indexed component in the specified array
211 *java.lang.reflect.Array.newInstance(Class<?>,int...)*
213 public static |java.lang.Object| newInstance(
214 java.lang.Class<?> componentType,
216 throws |java.lang.IllegalArgumentException|
217 |java.lang.NegativeArraySizeException|
219 Creates a new array with the specified component type and dimensions. If
220 componentType represents a non-array class or interface, the new array has
221 dimensions.length dimensions and componentType as its component type. If
222 componentType represents an array class, the number of dimensions of the new
223 array is equal to the sum of dimensions.length and the number of dimensions of
224 componentType. In this case, the component type of the new array is the
225 component type of componentType.
227 The number of dimensions of the new array must not exceed the number of array
228 dimensions supported by the implementation (typically 255).
231 componentType - the Class object representing the component type of the new array
232 dimensions - an array of int representing the dimensions of the new array
234 Returns: the new array
236 *java.lang.reflect.Array.newInstance(Class<?>,int)*
238 public static |java.lang.Object| newInstance(
239 java.lang.Class<?> componentType,
241 throws |java.lang.NegativeArraySizeException|
243 Creates a new array with the specified component type and length. Invoking this
244 method is equivalent to creating an array as follows:
248 int[] x = {length}; Array.newInstance(componentType, x);
253 componentType - the Class object representing the component type of the new array
254 length - the length of the new array
256 Returns: the new array
258 *java.lang.reflect.Array.set(Object,int,Object)*
260 public static native void set(
261 java.lang.Object array,
263 java.lang.Object value)
264 throws |java.lang.ArrayIndexOutOfBoundsException|
265 |java.lang.IllegalArgumentException|
267 Sets the value of the indexed component of the specified array object to the
268 specified new value. The new value is first automatically unwrapped if the
269 array has a primitive component type.
273 index - the index into the array
274 value - the new value of the indexed component
276 *java.lang.reflect.Array.setBoolean(Object,int,boolean)*
278 public static native void setBoolean(
279 java.lang.Object array,
282 throws |java.lang.ArrayIndexOutOfBoundsException|
283 |java.lang.IllegalArgumentException|
285 Sets the value of the indexed component of the specified array object to the
286 specified boolean value.
290 index - the index into the array
291 z - the new value of the indexed component
293 *java.lang.reflect.Array.setByte(Object,int,byte)*
295 public static native void setByte(
296 java.lang.Object array,
299 throws |java.lang.ArrayIndexOutOfBoundsException|
300 |java.lang.IllegalArgumentException|
302 Sets the value of the indexed component of the specified array object to the
303 specified byte value.
307 index - the index into the array
308 b - the new value of the indexed component
310 *java.lang.reflect.Array.setChar(Object,int,char)*
312 public static native void setChar(
313 java.lang.Object array,
316 throws |java.lang.ArrayIndexOutOfBoundsException|
317 |java.lang.IllegalArgumentException|
319 Sets the value of the indexed component of the specified array object to the
320 specified char value.
324 index - the index into the array
325 c - the new value of the indexed component
327 *java.lang.reflect.Array.setDouble(Object,int,double)*
329 public static native void setDouble(
330 java.lang.Object array,
333 throws |java.lang.ArrayIndexOutOfBoundsException|
334 |java.lang.IllegalArgumentException|
336 Sets the value of the indexed component of the specified array object to the
337 specified double value.
341 index - the index into the array
342 d - the new value of the indexed component
344 *java.lang.reflect.Array.setFloat(Object,int,float)*
346 public static native void setFloat(
347 java.lang.Object array,
350 throws |java.lang.ArrayIndexOutOfBoundsException|
351 |java.lang.IllegalArgumentException|
353 Sets the value of the indexed component of the specified array object to the
354 specified float value.
358 index - the index into the array
359 f - the new value of the indexed component
361 *java.lang.reflect.Array.setInt(Object,int,int)*
363 public static native void setInt(
364 java.lang.Object array,
367 throws |java.lang.ArrayIndexOutOfBoundsException|
368 |java.lang.IllegalArgumentException|
370 Sets the value of the indexed component of the specified array object to the
375 index - the index into the array
376 i - the new value of the indexed component
378 *java.lang.reflect.Array.setLong(Object,int,long)*
380 public static native void setLong(
381 java.lang.Object array,
384 throws |java.lang.ArrayIndexOutOfBoundsException|
385 |java.lang.IllegalArgumentException|
387 Sets the value of the indexed component of the specified array object to the
388 specified long value.
392 index - the index into the array
393 l - the new value of the indexed component
395 *java.lang.reflect.Array.setShort(Object,int,short)*
397 public static native void setShort(
398 java.lang.Object array,
401 throws |java.lang.ArrayIndexOutOfBoundsException|
402 |java.lang.IllegalArgumentException|
404 Sets the value of the indexed component of the specified array object to the
405 specified short value.
409 index - the index into the array
410 s - the new value of the indexed component