jdk/src/share/classes/java/lang/reflect/Array.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1996-2006 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.lang.reflect;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * The {@code Array} class provides static methods to dynamically create and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * access Java arrays.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * <p>{@code Array} permits widening conversions to occur during a get or set
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * operation, but throws an {@code IllegalArgumentException} if a narrowing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * conversion would occur.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * @author Nakul Saraiya
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
public final
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
class Array {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
     * Constructor.  Class Array is not instantiable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    private Array() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     * Creates a new array with the specified component type and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     * length.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     * Invoking this method is equivalent to creating an array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     * as follows:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * <blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * int[] x = {length};
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     * Array.newInstance(componentType, x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * </blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * @param componentType the {@code Class} object representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * component type of the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * @param length the length of the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * @return the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * @exception NullPointerException if the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * {@code componentType} parameter is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * @exception IllegalArgumentException if componentType is {@link Void#TYPE}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * @exception NegativeArraySizeException if the specified {@code length}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * is negative
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    public static Object newInstance(Class<?> componentType, int length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        throws NegativeArraySizeException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        return newArray(componentType, length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * Creates a new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * with the specified component type and dimensions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * If {@code componentType}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * represents a non-array class or interface, the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * has {@code dimensions.length} dimensions and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * {@code componentType} as its component type. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * {@code componentType} represents an array class, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * number of dimensions of the new array is equal to the sum
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * of {@code dimensions.length} and the number of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * dimensions of {@code componentType}. In this case, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * component type of the new array is the component type of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * {@code componentType}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * <p>The number of dimensions of the new array must not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * exceed the number of array dimensions supported by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * implementation (typically 255).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * @param componentType the {@code Class} object representing the component
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * type of the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * @param dimensions an array of {@code int} representing the dimensions of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * @return the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * @exception NullPointerException if the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * {@code componentType} argument is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * @exception IllegalArgumentException if the specified {@code dimensions}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * argument is a zero-dimensional array, or if the number of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * requested dimensions exceeds the limit on the number of array dimensions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * supported by the implementation (typically 255), or if componentType
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * is {@link Void#TYPE}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * @exception NegativeArraySizeException if any of the components in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * the specified {@code dimensions} argument is negative.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    public static Object newInstance(Class<?> componentType, int... dimensions)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        throws IllegalArgumentException, NegativeArraySizeException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        return multiNewArray(componentType, dimensions);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * Returns the length of the specified array object, as an {@code int}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * @return the length of the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * @exception IllegalArgumentException if the object argument is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * an array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    public static native int getLength(Object array)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        throws IllegalArgumentException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * array object.  The value is automatically wrapped in an object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * if it has a primitive type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @return the (possibly wrapped) value of the indexed component in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * an array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    public static native Object get(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * array object, as a {@code boolean}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    public static native boolean getBoolean(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * array object, as a {@code byte}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    public static native byte getByte(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * array object, as a {@code char}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    public static native char getChar(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * array object, as a {@code short}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    public static native short getShort(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * array object, as an {@code int}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    public static native int getInt(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * array object, as a {@code long}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    public static native long getLong(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * array object, as a {@code float}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    public static native float getFloat(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * array object, as a {@code double}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    public static native double getDouble(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * object to the specified new value.  The new value is first
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * automatically unwrapped if the array has a primitive component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * @param value the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * is not an array, or if the array component type is primitive and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * an unwrapping conversion fails
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    public static native void set(Object array, int index, Object value)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * object to the specified {@code boolean} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * @param z the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    public static native void setBoolean(Object array, int index, boolean z)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * object to the specified {@code byte} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * @param b the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
    public static native void setByte(Object array, int index, byte b)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * object to the specified {@code char} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * @param c the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    public static native void setChar(Object array, int index, char c)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * object to the specified {@code short} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * @param s the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    public static native void setShort(Object array, int index, short s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * object to the specified {@code int} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * @param i the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
    public static native void setInt(Object array, int index, int i)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * object to the specified {@code long} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * @param l the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
    public static native void setLong(Object array, int index, long l)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * object to the specified {@code float} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * @param f the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
    public static native void setFloat(Object array, int index, float f)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * object to the specified {@code double} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * @param d the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
    public static native void setDouble(Object array, int index, double d)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * Private
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
    private static native Object newArray(Class componentType, int length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
        throws NegativeArraySizeException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
    private static native Object multiNewArray(Class componentType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
        int[] dimensions)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
        throws IllegalArgumentException, NegativeArraySizeException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
}