Module JavaShortArray

module JavaShortArray: sig .. end
Support for short[] type.

type e = int 
The type of array elements.
type 'a t = 'a java_short_array 
The type of arrays.

Usual operations

val make : int32 -> e java_short_array
make len creates and returns an array of len elements. All elements are set to zero.

Raises Java_exception if len is negative.

val init : int32 -> (int32 -> e) -> e java_short_array
init len f creates and returns an array of len elements. The element at index i is initialized with value f i.

Raises Java_exception if len is negative.

val length : e java_short_array -> int32
length a returns the length of a.

Raises Java_exception if a is null.

val get : e java_short_array -> int32 -> e
get a i returns the element at index i in a.

Raises Java_exception if a is null, or i is out of bounds.

val set : e java_short_array -> int32 -> e -> unit
set a i x changes the element at index i in a to x.

Raises Java_exception if a is null, or i is out of bounds.

val append : e java_short_array ->
e java_short_array -> e java_short_array
append a1 a2 returns the concatenation of a1 and a2.

Raises Java_exception if either a1 or a2 is null.

val concat : e java_short_array list -> e java_short_array
concat l returns the concatenation of arrays in l.

Raises Java_exception if any of the arrays in l is null.

val sub : e java_short_array ->
int32 -> int32 -> e java_short_array
sub a ofs len returns an array of len elements, copying elements from a starting at offset ofs.

Raises Java_exception if a is null.

val copy : e java_short_array -> e java_short_array
copy a returns a copy of a.

Raises Java_exception if a is null.

val fill : e java_short_array ->
int32 -> int32 -> e -> unit
fill a ofs len x sets len elements of a to x, starting at offset ofs.

Raises Java_exception if a is null.

val blit : e java_short_array ->
int32 -> e java_short_array -> int32 -> int32 -> unit
blit src srcofs dst dstofs len copies len elements from src at offset srcofs to dst at offset dstofs.

Raises Java_exception if either src or ofs is null.

val to_list : e java_short_array -> e list
to_list a returns the elements of a as a list.

Raises Java_exception if a is null.

val of_list : e list -> e java_short_array
of_list l returns the elements of l as an array.

Raises Invalid_argument if l has more elements than can be represented by an int32 value.

val iter : (e -> unit) -> e java_short_array -> unit
iter f a applies f to each element of a.

Raises Java_exception if a is null.

val map : (e -> e) ->
e java_short_array -> e java_short_array
map f a returns an array with elemens f a_0, f a_1, ... where a_i is the element of a at index i.

Raises Java_exception if a is null.

val iteri : (int32 -> e -> unit) ->
e java_short_array -> unit
iter f a applies f to each element of a (also passing element index).

Raises Java_exception if a is null.

val mapi : (int32 -> e -> e) ->
e java_short_array -> e java_short_array
map f a returns an array with elemens f 0 a_0, f 1 a_1, ... where a_i is the element of a at index i.

Raises Java_exception if a is null.

val fold_left : ('a -> e -> 'a) ->
'a -> e java_short_array -> 'a
fold_left f z a returns f (... (f (f z a_0) a_1)) where a_i is the element of a at index i.

Raises Java_exception if a is null.

val fold_right : (e -> 'a -> 'a) ->
e java_short_array -> 'a -> 'a
fold_right f a z returns f a_0 (f a_1 (f ... z)) where a_i is the element of a at index i.

Raises Java_exception if a is null.


Conversion from/to OCaml arrays

val of_ocaml : e array -> e java_short_array
of_ocaml a returns a Java array equivalent to a.

Raises Invalid_argument if a has more elements than can be represented by an int32 value.

val to_ocaml : e java_short_array -> e array
to_ocaml a returns an OCaml array equivalent to a.

Raises Java_exception if a is null.


Java operations

val to_object : e java_short_array -> java'lang'Object java_instance
to_object a casts a to a bare object.
val of_object : java'lang'Object java_instance -> e java_short_array
of_object o casts object o to array.

Raises Java_exception if cast fails.

val null : e java_short_array
The null value.
val is_null : e java_short_array -> bool
is_null x returns true iff x is equal to null.
val is_not_null : e java_short_array -> bool
is_not_null x returns false iff x is equal to null.
val wrap : e java_short_array -> e java_short_array option
wrap x wraps the array x into an option type: