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 the sp
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.
45 *java.lang.reflect.Array.get(Object,int)*
47 public static native |java.lang.Object| get(
48 java.lang.Object array,
50 throws |java.lang.ArrayIndexOutOfBoundsException|
51 |java.lang.IllegalArgumentException|
53 Returns the value of the indexed component in the specified array object. The
54 value is automatically wrapped in an object if it has a primitive type.
59 Returns: the (possibly wrapped) value of the indexed component in the specified array
60 *java.lang.reflect.Array.getBoolean(Object,int)*
62 public static native boolean getBoolean(
63 java.lang.Object array,
65 throws |java.lang.ArrayIndexOutOfBoundsException|
66 |java.lang.IllegalArgumentException|
68 Returns the value of the indexed component in the specified array object, as a
74 Returns: the value of the indexed component in the specified array
75 *java.lang.reflect.Array.getByte(Object,int)*
77 public static native byte getByte(
78 java.lang.Object array,
80 throws |java.lang.ArrayIndexOutOfBoundsException|
81 |java.lang.IllegalArgumentException|
83 Returns the value of the indexed component in the specified array object, as a
89 Returns: the value of the indexed component in the specified array
90 *java.lang.reflect.Array.getChar(Object,int)*
92 public static native char getChar(
93 java.lang.Object array,
95 throws |java.lang.ArrayIndexOutOfBoundsException|
96 |java.lang.IllegalArgumentException|
98 Returns the value of the indexed component in the specified array object, as a
104 Returns: the value of the indexed component in the specified array
105 *java.lang.reflect.Array.getDouble(Object,int)*
107 public static native double getDouble(
108 java.lang.Object array,
110 throws |java.lang.ArrayIndexOutOfBoundsException|
111 |java.lang.IllegalArgumentException|
113 Returns the value of the indexed component in the specified array object, as a
119 Returns: the value of the indexed component in the specified array
120 *java.lang.reflect.Array.getFloat(Object,int)*
122 public static native float getFloat(
123 java.lang.Object array,
125 throws |java.lang.ArrayIndexOutOfBoundsException|
126 |java.lang.IllegalArgumentException|
128 Returns the value of the indexed component in the specified array object, as a
134 Returns: the value of the indexed component in the specified array
135 *java.lang.reflect.Array.getInt(Object,int)*
137 public static native int getInt(
138 java.lang.Object array,
140 throws |java.lang.ArrayIndexOutOfBoundsException|
141 |java.lang.IllegalArgumentException|
143 Returns the value of the indexed component in the specified array object, as an
149 Returns: the value of the indexed component in the specified array
150 *java.lang.reflect.Array.getLength(Object)*
152 public static native int getLength(java.lang.Object array)
153 throws |java.lang.IllegalArgumentException|
155 Returns the length of the specified array object, as an int.
159 Returns: the length of the array
160 *java.lang.reflect.Array.getLong(Object,int)*
162 public static native long getLong(
163 java.lang.Object array,
165 throws |java.lang.ArrayIndexOutOfBoundsException|
166 |java.lang.IllegalArgumentException|
168 Returns the value of the indexed component in the specified array object, as a
174 Returns: the value of the indexed component in the specified array
175 *java.lang.reflect.Array.getShort(Object,int)*
177 public static native short getShort(
178 java.lang.Object array,
180 throws |java.lang.ArrayIndexOutOfBoundsException|
181 |java.lang.IllegalArgumentException|
183 Returns the value of the indexed component in the specified array object, as a
189 Returns: the value of the indexed component in the specified array
190 *java.lang.reflect.Array.newInstance(Class,int)*
192 public static |java.lang.Object| newInstance(
193 java.lang.Class componentType,
195 throws |java.lang.NegativeArraySizeException|
197 Creates a new array with the specified component type and length. Invoking this
198 method is equivalent to creating an array as follows:
202 int[] x = {length}; Array.newInstance(componentType, x);
206 componentType - the Class object representing the component type of the new array
207 length - the length of the new array
209 Returns: the new array
210 *java.lang.reflect.Array.newInstance(Class,int[])*
212 public static |java.lang.Object| newInstance(
213 java.lang.Class componentType,
215 throws |java.lang.IllegalArgumentException|
216 |java.lang.NegativeArraySizeException|
218 Creates a new array with the specified component type and dimensions. If
219 componentType represents a non-array class or interface, the new array has
220 dimensions.length dimensions and componentType as its component type. If
221 componentType represents an array class, the number of dimensions of the new
222 array is equal to the sum of dimensions.length and the number of dimensions of
223 componentType. In this case, the component type of the new array is the
224 component type of componentType.
226 The number of dimensions of the new array must not exceed the number of array
227 dimensions supported by the implementation (typically 255).
229 componentType - the Class object representing the component type of the new array
230 dimensions - an array of int types representing the dimensions of the new array
232 Returns: the new array
233 *java.lang.reflect.Array.set(Object,int,Object)*
235 public static native void set(
236 java.lang.Object array,
238 java.lang.Object value)
239 throws |java.lang.ArrayIndexOutOfBoundsException|
240 |java.lang.IllegalArgumentException|
242 Sets the value of the indexed component of the specified array object to the
243 specified new value. The new value is first automatically unwrapped if the
244 array has a primitive component type.
247 index - the index into the array
248 value - the new value of the indexed component
250 *java.lang.reflect.Array.setBoolean(Object,int,boolean)*
252 public static native void setBoolean(
253 java.lang.Object array,
256 throws |java.lang.ArrayIndexOutOfBoundsException|
257 |java.lang.IllegalArgumentException|
259 Sets the value of the indexed component of the specified array object to the
260 specified boolean value.
263 index - the index into the array
264 z - the new value of the indexed component
266 *java.lang.reflect.Array.setByte(Object,int,byte)*
268 public static native void setByte(
269 java.lang.Object array,
272 throws |java.lang.ArrayIndexOutOfBoundsException|
273 |java.lang.IllegalArgumentException|
275 Sets the value of the indexed component of the specified array object to the
276 specified byte value.
279 index - the index into the array
280 b - the new value of the indexed component
282 *java.lang.reflect.Array.setChar(Object,int,char)*
284 public static native void setChar(
285 java.lang.Object array,
288 throws |java.lang.ArrayIndexOutOfBoundsException|
289 |java.lang.IllegalArgumentException|
291 Sets the value of the indexed component of the specified array object to the
292 specified char value.
295 index - the index into the array
296 c - the new value of the indexed component
298 *java.lang.reflect.Array.setDouble(Object,int,double)*
300 public static native void setDouble(
301 java.lang.Object array,
304 throws |java.lang.ArrayIndexOutOfBoundsException|
305 |java.lang.IllegalArgumentException|
307 Sets the value of the indexed component of the specified array object to the
308 specified double value.
311 index - the index into the array
312 d - the new value of the indexed component
314 *java.lang.reflect.Array.setFloat(Object,int,float)*
316 public static native void setFloat(
317 java.lang.Object array,
320 throws |java.lang.ArrayIndexOutOfBoundsException|
321 |java.lang.IllegalArgumentException|
323 Sets the value of the indexed component of the specified array object to the
324 specified float value.
327 index - the index into the array
328 f - the new value of the indexed component
330 *java.lang.reflect.Array.setInt(Object,int,int)*
332 public static native void setInt(
333 java.lang.Object array,
336 throws |java.lang.ArrayIndexOutOfBoundsException|
337 |java.lang.IllegalArgumentException|
339 Sets the value of the indexed component of the specified array object to the
343 index - the index into the array
344 i - the new value of the indexed component
346 *java.lang.reflect.Array.setLong(Object,int,long)*
348 public static native void setLong(
349 java.lang.Object array,
352 throws |java.lang.ArrayIndexOutOfBoundsException|
353 |java.lang.IllegalArgumentException|
355 Sets the value of the indexed component of the specified array object to the
356 specified long value.
359 index - the index into the array
360 l - the new value of the indexed component
362 *java.lang.reflect.Array.setShort(Object,int,short)*
364 public static native void setShort(
365 java.lang.Object array,
368 throws |java.lang.ArrayIndexOutOfBoundsException|
369 |java.lang.IllegalArgumentException|
371 Sets the value of the indexed component of the specified array object to the
372 specified short value.
375 index - the index into the array
376 s - the new value of the indexed component