java.lang.Object
org.seppiko.commons.utils.CharUtil
Character Util
- Author:
- Leonard Woo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Character'*'static final CharacterCR or'\r'static final StringCRLF or"\r\n"static final CharacterFF or'\f'static final Character'.'static final Character'*'static final Character'.'static final Character'-'static final Character'+'static final Character'\'static final Character'/'static final CharacterHT or'\t'static final Character'-'static final CharacterLF or'\n'static final CharacterNUL or'\0'static final Character'+'static final Character'\'static final Character'/'static final CharacterVT or'\v' -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CharBuffercharsetDecode(Charset charset, byte[] data) Charset decodestatic byte[]charsetEncode(Charset charset, CharBuffer data) Charset encodestatic booleanisDigit(char ch) Determines if the specified character is a digit.static booleanisFullStop(char ch) Determines if the specified character is a full stop.
-
Field Details
-
NULL
NUL or'\0' -
HORIZONTAL_TABULATION
HT or'\t' -
LINE_FEED
LF or'\n' -
VERTICAL_TABULATION
VT or'\v' -
FORM_FEED
FF or'\f' -
CARRIAGE_RETURN
CR or'\r' -
CRLF
CRLF or"\r\n" -
FULL_STOP
'.' -
HYPHEN_MINUS
'-' -
PLUS
'+' -
ASTERISK
'*' -
SOLIDUS
'/' -
REVERSE_SOLIDUS
'\' -
FULLWIDTH_FULL_STOP
'.' -
FULLWIDTH_HYPHEN_MINUS
'-' -
FULLWIDTH_PLUS
'+' -
FULLWIDTH_ASTERISK
'*' -
FULLWIDTH_SOLIDUS
'/' -
FULLWIDTH_REVERSE_SOLIDUS
'\'
-
-
Constructor Details
-
CharUtil
public CharUtil()
-
-
Method Details
-
charsetDecode
Charset decode- Parameters:
charset- charset, e.g.StandardCharsets.UTF_8data- byte array- Returns:
- character buffer object
- See Also:
-
charsetEncode
Charset encode- Parameters:
charset- charset, e.g.StandardCharsets.UTF_8data- character buffer- Returns:
- byte array
- See Also:
-
isDigit
public static boolean isDigit(char ch) Determines if the specified character is a digit.Some Unicode character ranges that contain digits:
'\u0030'through'\u0039', ISO-LATIN-1 digits ('0'through'9')'\uFF10'through'\uFF19', Fullwidth digits ('0'through'9')
- Parameters:
ch- the character to be tested.- Returns:
- true, if the character is a digit; false, otherwise.
-
isFullStop
public static boolean isFullStop(char ch) Determines if the specified character is a full stop.'\u002E', ISO-LATIN-1 full stop ('.''\uFF0E', Fullwidth digits ('.'
- Parameters:
ch- the character to be tested.- Returns:
- true, if the character is a digit; false, otherwise.
-