Module JavaByte

module JavaByte: sig .. end
Support for byte type and Byte class.


Instance creation

 
type t = java'lang'Byte java_instance
The type of wrappers for byte values.
 
val min_value : java_byte
The smallest value for byte values.
 
val max_value : java_byte
The largest value for byte values.
 
val make : java_byte -> t
Returns a new java.lang.Byte wrapper for the passed value.
 
val make_of_string : JavaString.t -> t
Returns a new java.lang.Byte corresponding to the passed string; see Byte(...).
Raises Java_exception if the string is invalid
 

Operations

 
val byte_value : t -> java_byte
Returns the wrapped value, as a byte.
 
val double_value : t -> java_double
Returns the wrapped value, as a double.
 
val float_value : t -> java_float
Returns the wrapped value, as a float.
 
val int_value : t -> java_int
Returns the wrapped value, as an int.
 
val long_value : t -> java_long
Returns the wrapped value, as a long.
 
val short_value : t -> java_short
Returns the wrapped value, as a short.
 
val compare : java_byte -> java_byte -> java_int
Compares the passed values.
 
val compare_to : t -> t -> java_int
Compares the passed values.
 
val to_string : java_byte -> JavaString.t
Converts the passed byte into a string; see toString(...).
 
val value_of : java_byte -> t
Converts the passed bare byte into a byte wrapper; see valueOf(...).
 
val parse_byte : ?radix:java_int -> JavaString.t -> java_byte
Converts the passed string into a byte wrapper, using the passed radix (defaulting to 10l); see parseByte(...).
Raises Java_exception if the string is invalid
 
val decode : JavaString.t -> t
Converts the passed string into a byte wrapper; see decode(...).
Raises Java_exception if the string is invalid
 
val value_of_string : ?radix:java_int -> JavaString.t -> t
Converts the passed string into a byte wrapper, using the passed radix (defaulting to 10l); see valueOf(...).
Raises Java_exception if the string is invalid
 

Null value

 
val null : t
The null value.
 
val is_null : t -> bool
is_null obj returns true iff obj is equal to null.
 
val is_not_null : t -> bool
is_not_null obj returns false iff obj is equal to null.
 

Miscellaneous

 
val wrap : t -> t option
wrap obj wraps the reference obj into an option type:
  • Some x if obj is not null;
  • None if obj is null.

 
val unwrap : t option -> t
unwrap obj unwraps the option obj into a bare reference:
  • Some x is mapped to x;
  • None is mapped to null.