Lines Matching refs:value

383      * Sets the element of the array at the specified index to the value.
384 * Equivalent to {@code array[index] = value}. If the array
385 * component is a primitive type, the value is automatically unboxed.
389 * if {@code array} is not an array or the value cannot be
394 public static void set(Object array, int index, Object value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
400 if (value != null && !array.getClass().getComponentType().isInstance(value)) {
403 ((Object[]) array)[index] = value;
405 if (value == null) {
408 if (value instanceof Boolean) {
409 setBoolean(array, index, ((Boolean) value).booleanValue());
410 } else if (value instanceof Byte) {
411 setByte(array, index, ((Byte) value).byteValue());
412 } else if (value instanceof Character) {
413 setChar(array, index, ((Character) value).charValue());
414 } else if (value instanceof Short) {
415 setShort(array, index, ((Short) value).shortValue());
416 } else if (value instanceof Integer) {
417 setInt(array, index, ((Integer) value).intValue());
418 } else if (value instanceof Long) {
419 setLong(array, index, ((Long) value).longValue());
420 } else if (value instanceof Float) {
421 setFloat(array, index, ((Float) value).floatValue());
422 } else if (value instanceof Double) {
423 setDouble(array, index, ((Double) value).doubleValue());
429 * Sets {@code array[index] = value}. Applies to boolean arrays.
433 * if the {@code array} is not an array or the value cannot be
438 public static void setBoolean(Object array, int index, boolean value) {
440 ((boolean[]) array)[index] = value;
447 * Sets {@code array[index] = value}. Applies to byte, double, float, int, long, and short arrays.
451 * if the {@code array} is not an array or the value cannot be
456 public static void setByte(Object array, int index, byte value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
458 ((byte[]) array)[index] = value;
460 ((double[]) array)[index] = value;
462 ((float[]) array)[index] = value;
464 ((int[]) array)[index] = value;
466 ((long[]) array)[index] = value;
468 ((short[]) array)[index] = value;
475 * Sets {@code array[index] = value}. Applies to char, double, float, int, and long arrays.
479 * if the {@code array} is not an array or the value cannot be
484 public static void setChar(Object array, int index, char value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
486 ((char[]) array)[index] = value;
488 ((double[]) array)[index] = value;
490 ((float[]) array)[index] = value;
492 ((int[]) array)[index] = value;
494 ((long[]) array)[index] = value;
501 * Sets {@code array[index] = value}. Applies to double arrays.
505 * if the {@code array} is not an array or the value cannot be
510 public static void setDouble(Object array, int index, double value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
512 ((double[]) array)[index] = value;
519 * Sets {@code array[index] = value}. Applies to double and float arrays.
523 * if the {@code array} is not an array or the value cannot be
528 public static void setFloat(Object array, int index, float value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
530 ((float[]) array)[index] = value;
532 ((double[]) array)[index] = value;
539 * Sets {@code array[index] = value}. Applies to double, float, int, and long arrays.
543 * if the {@code array} is not an array or the value cannot be
548 public static void setInt(Object array, int index, int value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
550 ((int[]) array)[index] = value;
552 ((double[]) array)[index] = value;
554 ((float[]) array)[index] = value;
556 ((long[]) array)[index] = value;
563 * Sets {@code array[index] = value}. Applies to double, float, and long arrays.
567 * if the {@code array} is not an array or the value cannot be
572 public static void setLong(Object array, int index, long value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
574 ((long[]) array)[index] = value;
576 ((double[]) array)[index] = value;
578 ((float[]) array)[index] = value;
585 * Sets {@code array[index] = value}. Applies to double, float, int, long, and short arrays.
589 * if the {@code array} is not an array or the value cannot be
594 public static void setShort(Object array, int index, short value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
596 ((short[]) array)[index] = value;
598 ((double[]) array)[index] = value;
600 ((float[]) array)[index] = value;
602 ((int[]) array)[index] = value;
604 ((long[]) array)[index] = value;