Functions - java.arrays

get

Returns a handle that refers to the element at the specified index in the given Java array.

This function completes abruptly with a panic, if the specified handle refers to a Java null, or if the handle does not refer to a Java array.

getLength

Returns the length of the given Java array.

newInstance

Returns a new Java array instance with the specified element type and dimensions.

This function completes abruptly with a panic, if the specified handle refers to a Java null, or if zero dimensions have been provided.

set

Replaces the indexed element at the specified index in the given Java array with the specified element.

This function completes abruptly with a panic, if the specified handle refers to a Java null, or if the handle does not refer to a Java array.

get

(handle array, int index)

returns handle

Returns a handle that refers to the element at the specified index in the given Java array.

This function completes abruptly with a panic, if the specified handle refers to a Java null, or if the handle does not refer to a Java array.

Parameters

  • array handle
  • the handle which referes to the Java array

  • index int
  • the index of the element to be returned

  • Return Type

    (handle)
  • the handle that refers to the element at the specified position in the Java array

getLength

(handle array)

returns int

Returns the length of the given Java array.

Parameters

  • array handle
  • the handle which referes to the Java array

  • Return Type

    (int)
  • the length of the given Java array

newInstance

(handle class, int dimensions)

returns handle

Returns a new Java array instance with the specified element type and dimensions.

This function completes abruptly with a panic, if the specified handle refers to a Java null, or if zero dimensions have been provided.

Parameters

  • class handle
  • the element type of the array

  • dimensions int
  • the dimentions of the array

  • Return Type

    (handle)
  • the new Java array instance

set

Replaces the indexed element at the specified index in the given Java array with the specified element.

This function completes abruptly with a panic, if the specified handle refers to a Java null, or if the handle does not refer to a Java array.

Parameters

  • array handle
  • the handle which referes to the Java array

  • index int
  • the index of the element to be replaced

  • element handle
  • the element to be stored at the specified index