📄 array.java
字号:
/** * Returns the value of the indexed component in the specified * array object, as a <code>float</code>. * * @param array the array * @param index the index * @return the value of the indexed component in the specified array * @exception NullPointerException If the specified object is null * @exception IllegalArgumentException If the specified object is not * an array, or if the indexed element cannot be converted to the * return type by an identity or widening conversion * @exception ArrayIndexOutOfBoundsException If the specified <code>index</code> * argument is negative, or if it is greater than or equal to the * length of the specified array * @see Array#get */ public static native float getFloat(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException; /** * Returns the value of the indexed component in the specified * array object, as a <code>double</code>. * * @param array the array * @param index the index * @return the value of the indexed component in the specified array * @exception NullPointerException If the specified object is null * @exception IllegalArgumentException If the specified object is not * an array, or if the indexed element cannot be converted to the * return type by an identity or widening conversion * @exception ArrayIndexOutOfBoundsException If the specified <code>index</code> * argument is negative, or if it is greater than or equal to the * length of the specified array * @see Array#get */ public static native double getDouble(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException; /** * Sets the value of the indexed component of the specified array * object to the specified new value. The new value is first * automatically unwrapped if the array has a primitive component * type. * @param array the array * @param index the index into the array * @param value the new value of the indexed component * @exception NullPointerException If the specified object argument * is null, or if the array component type is primitive and the specified * value is null * @exception IllegalArgumentException If the specified object argument * is not an array, or if the array component type is primitive and * the specified value cannot be converted to the primitive type by * a combination of unwrapping and identity or widening conversions * @exception ArrayIndexOutOfBoundsException If the specified <code>index</code> * argument is negative, or if it is greater than or equal to * the length of the specified array */ public static native void set(Object array, int index, Object value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException; /** * Sets the value of the indexed component of the specified array * object to the specified <code>boolean</code> value. * @param array the array * @param index the index into the array * @param z the new value of the indexed component * @exception NullPointerException If the specified object argument * is null * @exception IllegalArgumentException If the specified object argument * is not an array, or if the the specified value cannot be converted * to the underlying array's component type by an identity or a * primitive widening widening conversion * @exception ArrayIndexOutOfBoundsException If the specified <code>index</code> * argument is negative, or if it is greater than or equal to * the length of the specified array * @see Array#set */ public static native void setBoolean(Object array, int index, boolean z) throws IllegalArgumentException, ArrayIndexOutOfBoundsException; /** * Sets the value of the indexed component of the specified array * object to the specified <code>byte</code> value. * @param array the array * @param index the index into the array * @param b the new value of the indexed component * @exception NullPointerException If the specified object argument * is null * @exception IllegalArgumentException If the specified object argument * is not an array, or if the the specified value cannot be converted * to the underlying array's component type by an identity or a * primitive widening widening conversion * @exception ArrayIndexOutOfBoundsException If the specified <code>index</code> * argument is negative, or if it is greater than or equal to * the length of the specified array * @see Array#set */ public static native void setByte(Object array, int index, byte b) throws IllegalArgumentException, ArrayIndexOutOfBoundsException; /** * Sets the value of the indexed component of the specified array * object to the specified <code>char</code> value. * @param array the array * @param index the index into the array * @param c the new value of the indexed component * @exception NullPointerException If the specified object argument * is null * @exception IllegalArgumentException If the specified object argument * is not an array, or if the the specified value cannot be converted * to the underlying array's component type by an identity or a * primitive widening widening conversion * @exception ArrayIndexOutOfBoundsException If the specified <code>index</code> * argument is negative, or if it is greater than or equal to * the length of the specified array * @see Array#set */ public static native void setChar(Object array, int index, char c) throws IllegalArgumentException, ArrayIndexOutOfBoundsException; /** * Sets the value of the indexed component of the specified array * object to the specified <code>short</code> value. * @param array the array * @param index the index into the array * @param s the new value of the indexed component * @exception NullPointerException If the specified object argument * is null * @exception IllegalArgumentException If the specified object argument * is not an array, or if the the specified value cannot be converted * to the underlying array's component type by an identity or a * primitive widening widening conversion * @exception ArrayIndexOutOfBoundsException If the specified <code>index</code> * argument is negative, or if it is greater than or equal to * the length of the specified array * @see Array#set */ public static native void setShort(Object array, int index, short s) throws IllegalArgumentException, ArrayIndexOutOfBoundsException; /** * Sets the value of the indexed component of the specified array * object to the specified <code>int</code> value. * @param array the array * @param index the index into the array * @param i the new value of the indexed component * @exception NullPointerException If the specified object argument * is null * @exception IllegalArgumentException If the specified object argument * is not an array, or if the the specified value cannot be converted * to the underlying array's component type by an identity or a * primitive widening widening conversion * @exception ArrayIndexOutOfBoundsException If the specified <code>index</code> * argument is negative, or if it is greater than or equal to * the length of the specified array * @see Array#set */ public static native void setInt(Object array, int index, int i) throws IllegalArgumentException, ArrayIndexOutOfBoundsException; /** * Sets the value of the indexed component of the specified array * object to the specified <code>long</code> value. * @param array the array * @param index the index into the array * @param l the new value of the indexed component * @exception NullPointerException If the specified object argument * is null * @exception IllegalArgumentException If the specified object argument * is not an array, or if the the specified value cannot be converted * to the underlying array's component type by an identity or a * primitive widening widening conversion * @exception ArrayIndexOutOfBoundsException If the specified <code>index</code> * argument is negative, or if it is greater than or equal to * the length of the specified array * @see Array#set */ public static native void setLong(Object array, int index, long l) throws IllegalArgumentException, ArrayIndexOutOfBoundsException; /** * Sets the value of the indexed component of the specified array * object to the specified <code>float</code> value. * @param array the array * @param index the index into the array * @param f the new value of the indexed component * @exception NullPointerException If the specified object argument * is null * @exception IllegalArgumentException If the specified object argument * is not an array, or if the the specified value cannot be converted * to the underlying array's component type by an identity or a * primitive widening widening conversion * @exception ArrayIndexOutOfBoundsException If the specified <code>index</code> * argument is negative, or if it is greater than or equal to * the length of the specified array * @see Array#set */ public static native void setFloat(Object array, int index, float f) throws IllegalArgumentException, ArrayIndexOutOfBoundsException; /** * Sets the value of the indexed component of the specified array * object to the specified <code>double</code> value. * @param array the array * @param index the index into the array * @param d the new value of the indexed component * @exception NullPointerException If the specified object argument * is null * @exception IllegalArgumentException If the specified object argument * is not an array, or if the the specified value cannot be converted * to the underlying array's component type by an identity or a * primitive widening widening conversion * @exception ArrayIndexOutOfBoundsException If the specified <code>index</code> * argument is negative, or if it is greater than or equal to * the length of the specified array * @see Array#set */ public static native void setDouble(Object array, int index, double d) throws IllegalArgumentException, ArrayIndexOutOfBoundsException; /* * Private */ private static native Object newArray(Class componentType, int length) throws NegativeArraySizeException; private static native Object multiNewArray(Class componentType, int[] dimensions) throws IllegalArgumentException, NegativeArraySizeException;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -