Package com.atlassian.adf.util
Class Char
- java.lang.Object
-
- com.atlassian.adf.util.Char
-
@Internal public abstract class Char extends Object
Fromeditor-wikimarkup-transformer/src/char.tsoriginally, but there is a lot more in here, now.
-
-
Field Summary
Fields Modifier and Type Field Description static StringEM_DASHAn em dash, "\u2014".static StringEN_DASHAn en dash, "\u2013".static StringNBSPA non-breaking space, "\u00a0".static StringPAPERCLIPA paperclip emoji, "\ud83d\udcce".static StringWJA word-joiner, which has no visual representation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static charhex(int hexit)Returns the hexadecimal digit for the given value, which must be in the range[0, 15].static booleanisAlnum(char c)Checks for a simple ASCII alphanumeric character, meaning one of the decimal digit'0'through'9', an uppercase unmodified English-language letter'A'through'Z', or the same'a'through'z'range in lowercase.static booleanisAlpha(char c)Checks for a simple ASCII alphabetic character, meaning an uppercase unmodified English-language letter'A'through'Z', or the same'a'through'z'range in lowercase.static booleanisDigit(char c)Checks for a simple ASCII digit, meaning a decimal digit'0'through'9'.static booleanisHexit(char c)Checks for a simple ASCII hexadecimal digit, meaning a decimal digit'0'through'9'or one of the letters'A'through'F'(allowing both uppercase or lowercase).static booleanisLineTerminator(char c)Checks whether the given character is a line terminator in the sense of what matches the.character in a non-multiline regex.static booleanisLower(char c)Checks for a simple ASCII lowercase letter, meaning'a'through'z'.static booleanisSpace(char c)Checks for a simple ASCII whitespace character as defined by the\scharacter class in regular expression patterns.static booleanisUpper(char c)Checks for a simple ASCII uppercase letter, meaning'A'through'Z'.
-
-
-
Field Detail
-
EN_DASH
public static final String EN_DASH
An en dash, "\u2013".- See Also:
- Constant Field Values
-
EM_DASH
public static final String EM_DASH
An em dash, "\u2014".- See Also:
- Constant Field Values
-
NBSP
public static final String NBSP
A non-breaking space, "\u00a0".- See Also:
- Constant Field Values
-
PAPERCLIP
public static final String PAPERCLIP
A paperclip emoji, "\ud83d\udcce".- See Also:
- Constant Field Values
-
WJ
public static final String WJ
A word-joiner, which has no visual representation.- See Also:
- Constant Field Values
-
-
Method Detail
-
isAlpha
public static boolean isAlpha(char c)
Checks for a simple ASCII alphabetic character, meaning an uppercase unmodified English-language letter'A'through'Z', or the same'a'through'z'range in lowercase.- Parameters:
c- the character to consider- Returns:
trueif the character is a simple ASCII alphanumeric;falseif it is anything else
-
isAlnum
public static boolean isAlnum(char c)
Checks for a simple ASCII alphanumeric character, meaning one of the decimal digit'0'through'9', an uppercase unmodified English-language letter'A'through'Z', or the same'a'through'z'range in lowercase.- Parameters:
c- the character to consider- Returns:
trueif the character is a simple ASCII alphanumeric;falseif it is anything else
-
isHexit
public static boolean isHexit(char c)
Checks for a simple ASCII hexadecimal digit, meaning a decimal digit'0'through'9'or one of the letters'A'through'F'(allowing both uppercase or lowercase).- Parameters:
c- the character to consider- Returns:
trueif the character is a simple ASCII hex digit;falseif it is anything else
-
isDigit
public static boolean isDigit(char c)
Checks for a simple ASCII digit, meaning a decimal digit'0'through'9'.- Parameters:
c- the character to consider- Returns:
trueif the character is a simple ASCII digit;falseif it is anything else
-
isUpper
public static boolean isUpper(char c)
Checks for a simple ASCII uppercase letter, meaning'A'through'Z'.- Parameters:
c- the character to consider- Returns:
trueif the character is a simple ASCII uppercase letter;falseif it is anything else
-
isLower
public static boolean isLower(char c)
Checks for a simple ASCII lowercase letter, meaning'a'through'z'.- Parameters:
c- the character to consider- Returns:
trueif the character is a simple ASCII lowercase letter;falseif it is anything else
-
isSpace
public static boolean isSpace(char c)
Checks for a simple ASCII whitespace character as defined by the\scharacter class in regular expression patterns.- Parameters:
c- the character to consider- Returns:
- true if the character matches the character class
\s, which is equivalent to[ \t\n\x0B\f\r].
-
isLineTerminator
public static boolean isLineTerminator(char c)
Checks whether the given character is a line terminator in the sense of what matches the.character in a non-multiline regex.- Parameters:
c- the character to consider- Returns:
- true if the character matches the character class, which includes any of the characters
U+000A,U+000D,U+0085,U+2028, orU+2029.
-
hex
public static char hex(int hexit)
Returns the hexadecimal digit for the given value, which must be in the range[0, 15]. For the values in the range[10, 15], uppercase letters are used.- Parameters:
hexit- the value to represent as a hex digit- Returns:
- the character that represents it, using uppercase for any letters
- Throws:
IndexOutOfBoundsException- ifhexitis out of the accepted range
-
-