jdk/src/java.base/share/classes/java/lang/reflect/Array.java
author zmajo
Fri, 03 Jul 2015 07:23:45 +0200
changeset 31671 362e0c0acece
parent 25859 3317bb8137f4
child 45434 4582657c7260
permissions -rw-r--r--
8076112: Add @HotSpotIntrinsicCandidate annotation to indicate methods for which Java Runtime has intrinsics Summary: Annotate possibly intrinsified methods with @HotSpotIntrinsicCandidate. Add checks omitted by intrinsics to the library code. Add CheckIntrinsics flags to check consistency of intrinsics. Reviewed-by: jrose, kvn, thartmann, vlivanov, abuckley, darcy, ascarpino, briangoetz, alanb, aph, dnsimon
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 20769
diff changeset
     2
 * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
2
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
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
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
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
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
31671
362e0c0acece 8076112: Add @HotSpotIntrinsicCandidate annotation to indicate methods for which Java Runtime has intrinsics
zmajo
parents: 25859
diff changeset
    28
import jdk.internal.HotSpotIntrinsicCandidate;
362e0c0acece 8076112: Add @HotSpotIntrinsicCandidate annotation to indicate methods for which Java Runtime has intrinsics
zmajo
parents: 25859
diff changeset
    29
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * The {@code Array} class provides static methods to dynamically create and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * access Java arrays.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * <p>{@code Array} permits widening conversions to occur during a get or set
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * operation, but throws an {@code IllegalArgumentException} if a narrowing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * conversion would occur.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * @author Nakul Saraiya
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
public final
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
class Array {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
     * Constructor.  Class Array is not instantiable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    private Array() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     * Creates a new array with the specified component type and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     * length.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * Invoking this method is equivalent to creating an array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * as follows:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * <blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * int[] x = {length};
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * Array.newInstance(componentType, x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * </blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     *
20769
01c5635d1d1a 7044282: (reflect) Class.forName and Array.newInstance are inconsistent regarding multidimensional arrays
jfranck
parents: 14342
diff changeset
    60
     * <p>The number of dimensions of the new array must not
01c5635d1d1a 7044282: (reflect) Class.forName and Array.newInstance are inconsistent regarding multidimensional arrays
jfranck
parents: 14342
diff changeset
    61
     * exceed 255.
01c5635d1d1a 7044282: (reflect) Class.forName and Array.newInstance are inconsistent regarding multidimensional arrays
jfranck
parents: 14342
diff changeset
    62
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * @param componentType the {@code Class} object representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * component type of the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * @param length the length of the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * @return the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * @exception NullPointerException if the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * {@code componentType} parameter is null
20769
01c5635d1d1a 7044282: (reflect) Class.forName and Array.newInstance are inconsistent regarding multidimensional arrays
jfranck
parents: 14342
diff changeset
    69
     * @exception IllegalArgumentException if componentType is {@link
01c5635d1d1a 7044282: (reflect) Class.forName and Array.newInstance are inconsistent regarding multidimensional arrays
jfranck
parents: 14342
diff changeset
    70
     * Void#TYPE} or if the number of dimensions of the requested array
01c5635d1d1a 7044282: (reflect) Class.forName and Array.newInstance are inconsistent regarding multidimensional arrays
jfranck
parents: 14342
diff changeset
    71
     * instance exceed 255.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * @exception NegativeArraySizeException if the specified {@code length}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * is negative
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    public static Object newInstance(Class<?> componentType, int length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        throws NegativeArraySizeException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        return newArray(componentType, length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * Creates a new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * with the specified component type and dimensions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * If {@code componentType}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * represents a non-array class or interface, the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * has {@code dimensions.length} dimensions and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * {@code componentType} as its component type. If
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * {@code componentType} represents an array class, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * number of dimensions of the new array is equal to the sum
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * of {@code dimensions.length} and the number of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * dimensions of {@code componentType}. In this case, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * component type of the new array is the component type of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * {@code componentType}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * <p>The number of dimensions of the new array must not
20769
01c5635d1d1a 7044282: (reflect) Class.forName and Array.newInstance are inconsistent regarding multidimensional arrays
jfranck
parents: 14342
diff changeset
    95
     * exceed 255.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * @param componentType the {@code Class} object representing the component
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * type of the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @param dimensions an array of {@code int} representing the dimensions of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * @return the new array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * @exception NullPointerException if the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * {@code componentType} argument is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * @exception IllegalArgumentException if the specified {@code dimensions}
20769
01c5635d1d1a 7044282: (reflect) Class.forName and Array.newInstance are inconsistent regarding multidimensional arrays
jfranck
parents: 14342
diff changeset
   105
     * argument is a zero-dimensional array, if componentType is {@link
01c5635d1d1a 7044282: (reflect) Class.forName and Array.newInstance are inconsistent regarding multidimensional arrays
jfranck
parents: 14342
diff changeset
   106
     * Void#TYPE}, or if the number of dimensions of the requested array
01c5635d1d1a 7044282: (reflect) Class.forName and Array.newInstance are inconsistent regarding multidimensional arrays
jfranck
parents: 14342
diff changeset
   107
     * instance exceed 255.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * @exception NegativeArraySizeException if any of the components in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * the specified {@code dimensions} argument is negative.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    public static Object newInstance(Class<?> componentType, int... dimensions)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        throws IllegalArgumentException, NegativeArraySizeException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        return multiNewArray(componentType, dimensions);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * Returns the length of the specified array object, as an {@code int}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * @return the length of the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * @exception IllegalArgumentException if the object argument is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * an array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     */
31671
362e0c0acece 8076112: Add @HotSpotIntrinsicCandidate annotation to indicate methods for which Java Runtime has intrinsics
zmajo
parents: 25859
diff changeset
   124
    @HotSpotIntrinsicCandidate
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    public static native int getLength(Object array)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        throws IllegalArgumentException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * array object.  The value is automatically wrapped in an object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * if it has a primitive type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * @return the (possibly wrapped) value of the indexed component in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * an array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    public static native Object get(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * array object, as a {@code boolean}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    public static native boolean getBoolean(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * array object, as a {@code byte}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    public static native byte getByte(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * array object, as a {@code char}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    public static native char getChar(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * array object, as a {@code short}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    public static native short getShort(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * array object, as an {@code int}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    public static native int getInt(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * array object, as a {@code long}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    public static native long getLong(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * array object, as a {@code float}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    public static native float getFloat(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * Returns the value of the indexed component in the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * array object, as a {@code double}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * @param index the index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * @return the value of the indexed component in the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * @exception NullPointerException If the specified object is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * @exception IllegalArgumentException If the specified object is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * an array, or if the indexed element cannot be converted to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * return type by an identity or widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * argument is negative, or if it is greater than or equal to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * @see Array#get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    public static native double getDouble(Object array, int index)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * object to the specified new value.  The new value is first
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * automatically unwrapped if the array has a primitive component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * @param value the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * is not an array, or if the array component type is primitive and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * an unwrapping conversion fails
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
    public static native void set(Object array, int index, Object value)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * object to the specified {@code boolean} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * @param z the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    public static native void setBoolean(Object array, int index, boolean z)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * object to the specified {@code byte} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * @param b the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    public static native void setByte(Object array, int index, byte b)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * object to the specified {@code char} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * @param c the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    public static native void setChar(Object array, int index, char c)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * object to the specified {@code short} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * @param s the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
    public static native void setShort(Object array, int index, short s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * object to the specified {@code int} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * @param i the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    public static native void setInt(Object array, int index, int i)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * object to the specified {@code long} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * @param l the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
    public static native void setLong(Object array, int index, long l)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     * object to the specified {@code float} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * @param f the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
    public static native void setFloat(Object array, int index, float f)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * Sets the value of the indexed component of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * object to the specified {@code double} value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * @param array the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * @param index the index into the array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * @param d the new value of the indexed component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * @exception NullPointerException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * @exception IllegalArgumentException If the specified object argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     * is not an array, or if the specified value cannot be converted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     * to the underlying array's component type by an identity or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     * primitive widening conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * @exception ArrayIndexOutOfBoundsException If the specified {@code index}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * argument is negative, or if it is greater than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * the length of the specified array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * @see Array#set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
    public static native void setDouble(Object array, int index, double d)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
        throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * Private
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
31671
362e0c0acece 8076112: Add @HotSpotIntrinsicCandidate annotation to indicate methods for which Java Runtime has intrinsics
zmajo
parents: 25859
diff changeset
   483
    @HotSpotIntrinsicCandidate
10342
ca0984bc9d32 7077389: Reflection classes do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   484
    private static native Object newArray(Class<?> componentType, int length)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
        throws NegativeArraySizeException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
10342
ca0984bc9d32 7077389: Reflection classes do not build with javac -Xlint:all -Werror
jjg
parents: 5506
diff changeset
   487
    private static native Object multiNewArray(Class<?> componentType,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
        int[] dimensions)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
        throws IllegalArgumentException, NegativeArraySizeException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
}