Microsoft SDK for Java

setBoolean

The setBoolean method of the SafeArray Class contains the following signatures:

setBoolean(int idx, boolean val)
setBoolean(int idx1, int idx2, boolean val)

setBoolean(int idx, boolean val)

Sets an element of a one-dimensional SafeArray.

Syntax

public native void setBoolean(int idx, boolean val);

Parameters

idx The element index, which ranges from index of the lower bound to the index of the upper bound.
val The new element value.

Exceptions

IndexOutOfBoundsException if the array is not one-dimensional or if idx does not lie between the lower bound and the upper bound of the SafeArray (inclusive).

ClassCastException if the Java value cannot be converted to the SafeArray element type using the Win32 VariantChangeType function.

setBoolean(int idx1, int idx2, boolean val)

Sets an element of a two-dimensional SafeArray.

Syntax

public void setBoolean(int idx1, int idx2, boolean val);

Parameters

idx1 The first dimension index of the element to set, which ranges from LBound(1) to UBound(1).
idx2 The second dimension index of the element to set, which ranges from LBound(2) to UBound(2).
val The new element value.

Exceptions

IndexOutOfBoundsException if the SafeArray is not two-dimensional or if either index lies outside the defined range.

ClassCastException if the Java value cannot be converted to the SafeArray element type using the Win32 VariantChangeType function.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.