Module JavaChar

module JavaChar: sig .. end
Utility functions for char type and Character class.


Instance creation

 
type t = java'lang'Character java_instance
The type of wrappers for character values.
 
val min_value : java_char
The smallest value for character values.
 
val max_value : java_char
The largest value for character values.
 
val make : java_char -> t
Returns a new java.lang.Character wrapper for the passed value.
 

Operations

 
val char_value : t -> java_char
Returns the wrapped value.
 
val compare : java_char -> java_char -> java_int
Compares the passed values.
 
val compare_to : t -> t -> java_int
Compares the passed values.
 
val is_digit : java_char -> bool
Tests whether the passed value is a digit; see isDigit(...).
 
val is_letter : java_char -> bool
Tests whether the passed value is a letter; see isLetter(...).
 
val is_letter_or_digit : java_char -> bool
Tests whether the passed value is a letter or a digit; see isLetterOrDigit(...).
 
val is_lower_case : java_char -> bool
Tests whether the passed value is lower case; see isLowerCase(...).
 
val is_space_char : java_char -> bool
Tests whether the passed value is a space character; see isSpaceChar(...).
 
val is_upper_case : java_char -> bool
Tests whether the passed value is upper case; see isUpperCase(...).
 
val is_whitespace : java_char -> bool
Tests whether the passed value is a white space; see isWhitespace(...).
 
val to_lower_case : java_char -> java_char
Converts the passed value to lower case; see toLowerCase(...).
 
val to_upper_case : java_char -> java_char
Converts the passed value to upper case; see toUpperCase(...).
 
val to_string : java_char -> JavaString.t
Converts the passed character into a string; see toString(...).
 
val value_of : java_char -> t
Converts the passed bare character into a character wrapper; see valueOf(...).
 

Conversion from/to OCaml characters

 
val of_char : char -> java_char
Converts a plain OCaml char into a java_char.
 
val to_char : java_char -> char
Converts a java_char into a plain OCaml char.
Raises Invalid_argument if the passed java_char cannot be represented as a char.
 

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.