Class CharUtil

java.lang.Object
org.seppiko.commons.utils.CharUtil

public class CharUtil extends Object
Character Util
Author:
Leonard Woo
  • Field Details

    • NULL

      public static final Character NULL
      NUL or '\0'
    • HORIZONTAL_TABULATION

      public static final Character HORIZONTAL_TABULATION
      HT or '\t'
    • LINE_FEED

      public static final Character LINE_FEED
      LF or '\n'
    • VERTICAL_TABULATION

      public static final Character VERTICAL_TABULATION
      VT or '\v'
    • FORM_FEED

      public static final Character FORM_FEED
      FF or '\f'
    • CARRIAGE_RETURN

      public static final Character CARRIAGE_RETURN
      CR or '\r'
    • CRLF

      public static final String CRLF
      CRLF or "\r\n"
    • FULL_STOP

      public static final Character FULL_STOP
      '.'
    • HYPHEN_MINUS

      public static final Character HYPHEN_MINUS
      '-'
    • PLUS

      public static final Character PLUS
      '+'
    • ASTERISK

      public static final Character ASTERISK
      '*'
    • SOLIDUS

      public static final Character SOLIDUS
      '/'
    • REVERSE_SOLIDUS

      public static final Character REVERSE_SOLIDUS
      '\'
    • FULLWIDTH_FULL_STOP

      public static final Character FULLWIDTH_FULL_STOP
      '.'
    • FULLWIDTH_HYPHEN_MINUS

      public static final Character FULLWIDTH_HYPHEN_MINUS
      '-'
    • FULLWIDTH_PLUS

      public static final Character FULLWIDTH_PLUS
      '+'
    • FULLWIDTH_ASTERISK

      public static final Character FULLWIDTH_ASTERISK
      '*'
    • FULLWIDTH_SOLIDUS

      public static final Character FULLWIDTH_SOLIDUS
      '/'
    • FULLWIDTH_REVERSE_SOLIDUS

      public static final Character FULLWIDTH_REVERSE_SOLIDUS
      '\'
  • Constructor Details

    • CharUtil

      public CharUtil()
  • Method Details

    • charsetDecode

      public static CharBuffer charsetDecode(Charset charset, byte[] data)
      Charset decode
      Parameters:
      charset - charset, e.g. StandardCharsets.UTF_8
      data - byte array
      Returns:
      character buffer object
      See Also:
    • charsetEncode

      public static byte[] charsetEncode(Charset charset, CharBuffer data)
      Charset encode
      Parameters:
      charset - charset, e.g. StandardCharsets.UTF_8
      data - 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.