Maven module :un.api : api-common :
Class : un.api.character.Char
Extends/Implements : un.api.CObject
Subclasses : -

A single character.
author  Johann Sorel


Variables : encoding, data
Functions : Char, Char, Char, Char, getByteLength, getEncoding, recode, isUpperCase, isUpperCase, isLowerCase, isLowerCase, toUpperCase, toUpperCase, toLowerCase, toLowerCase, toBytes, toBytes, toUnicode, toChars, getHash, equals, equals, equals, toEncodingBytes, isDigit


CharEncoding encoding

byte[] data


public void Char (char data, CharEncoding encoding)

public void Char (byte[] data, CharEncoding encoding)

public void Char (int cp)

public void Char (int cp, CharEncoding encoding)


Number of bytes used by this character.
return  int
public int getByteLength ()


Get character encoding.
return  CharEncoding
public CharEncoding getEncoding ()


Encode this character with a different encoding.
param  encoding target encoding
return  Char
public Char recode (CharEncoding encoding)


return  true if character is uppercase
public boolean isUpperCase ()


param  lf character case
return  true if character is uppercase
public boolean isUpperCase (CharCase lf)


return  true if character is lowercase
public boolean isLowerCase ()


param  lf character case
return  true if character is lowercase
public boolean isLowerCase (CharCase lf)

public Char toUpperCase ()

public Char toUpperCase (CharCase lf)

public Char toLowerCase ()

public Char toLowerCase (CharCase lf)


Get the char as bytes in it's current encoding.
return  byte array
public byte[] toBytes ()


Get the char as bytes in given encoding.
param  encoding target encoding
return  byte array
public byte[] toBytes (CharEncoding encoding)

public int toUnicode ()

public Chars toChars ()

public int getHash ()


Default equals method.
Case sensitive and encoding unsensitive.
param  obj , object to test, can be null
return  true if equals
public boolean equals (Object obj)


Equals method with current default language.
param  obj , object to test, can be null
param  ignoreCase set to true to ignore case
param  ignoreEncoding set to true to ignore encoding
return  true if equals
public boolean equals (Object obj, boolean ignoreCase, boolean ignoreEncoding)


Equals method with current default language.
param  obj , object to test, can be null
param  ignoreCase set to true to ignore case
param  ignoreEncoding set to true to ignore encoding
param  language language to use for case test, if null will use default language.
return  true if equals
public boolean equals (Object obj, boolean ignoreCase, boolean ignoreEncoding, CharCase language)


No byte array copy, do not modify.
byte[] toEncodingBytes (CharEncoding otherEnc)


Test if given character is a digit.
param  unicode character unicode codepoint
return  true if digit
public boolean isDigit (int unicode)