public class CharUtil
extends java.lang.Object
char[]
- byte[]
conversions.Modifier and Type | Field and Description |
---|---|
static char[] |
HEX_CHARS |
Constructor and Description |
---|
CharUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
equalsOne(char c,
char[] match)
Match if one character equals to any of the given character.
|
static int |
findFirstDiff(char[] source,
int index,
char match)
Finds index of the first character in given array the differs from the
given set of characters.
|
static int |
findFirstDiff(char[] source,
int index,
char[] match)
Finds index of the first character in given array the differs from the
given set of characters.
|
static int |
findFirstEqual(char[] source,
int index,
char match)
Finds index of the first character in given array the matches any from the
given set of characters.
|
static int |
findFirstEqual(char[] source,
int index,
char[] match)
Finds index of the first character in given array the matches any from the
given set of characters.
|
static int |
hex2int(char c)
Converts hex char to int value.
|
static char |
int2hex(int i)
Converts integer digit to heck char.
|
static boolean |
isAlpha(char c)
Indicates whether the given character is in the
ALPHA set. |
static boolean |
isAlphaOrDigit(char c) |
static boolean |
isDigit(char c)
Indicates whether the given character is in the
DIGIT set. |
static boolean |
isGenericDelimiter(int c)
Indicates whether the given character is in the gen-delims set.
|
static boolean |
isHexDigit(char c)
Indicates whether the given character is the hexadecimal digit.
|
static boolean |
isLowercaseAlpha(char c)
Returns
true if specified character is lowercase ASCII. |
static boolean |
isPchar(char c)
Indicates whether the given character is in the pchar set.
|
static boolean |
isPropertyNameChar(char c) |
static boolean |
isReserved(char c)
Indicates whether the given character is in the reserved set.
|
static boolean |
isSubDelimiter(int c)
Indicates whether the given character is in the sub-delims set.
|
static boolean |
isUnreserved(char c)
Indicates whether the given character is in the unreserved set.
|
static boolean |
isUppercaseAlpha(char c)
Returns
true if specified character is uppercase ASCII. |
static boolean |
isWhitespace(char c)
Returns
true if character is a white space (<= ' ' ). |
static boolean |
isWordChar(char c) |
static int |
toAscii(char c)
Returns ASCII value of a char.
|
static byte[] |
toAsciiByteArray(char[] carr)
Converts char array into
ASCII array. |
static byte[] |
toAsciiByteArray(java.lang.CharSequence charSequence)
Converts char sequence into ASCII byte array.
|
static byte[] |
toByteArray(char[] carr)
Converts char array to byte array using default Jodd encoding.
|
static byte[] |
toByteArray(char[] carr,
java.lang.String charset)
Converts char array to byte array using provided encoding.
|
static char |
toChar(byte b)
Converts (signed) byte to (unsigned) char.
|
static char[] |
toCharArray(byte[] barr)
Converts byte array of default Jodd encoding to char array.
|
static char[] |
toCharArray(byte[] barr,
java.lang.String charset)
Converts byte array of specific encoding to char array.
|
static char |
toLowerAscii(char c)
Lowers uppercase ASCII char.
|
static byte[] |
toRawByteArray(char[] carr)
Converts char array into byte array by replacing each character with two bytes.
|
static char[] |
toRawCharArray(byte[] barr) |
static byte[] |
toSimpleByteArray(char[] carr)
Converts char array into byte array by stripping the high byte of each character.
|
static byte[] |
toSimpleByteArray(java.lang.CharSequence charSequence)
Converts char sequence into byte array.
|
static char[] |
toSimpleCharArray(byte[] barr)
Converts byte array to char array by simply extending bytes to chars.
|
static char |
toUpperAscii(char c)
Uppers lowercase ASCII char.
|
public static char toChar(byte b)
public static byte[] toSimpleByteArray(char[] carr)
public static byte[] toSimpleByteArray(java.lang.CharSequence charSequence)
toSimpleByteArray(char[])
public static char[] toSimpleCharArray(byte[] barr)
public static int toAscii(char c)
public static byte[] toAsciiByteArray(char[] carr)
ASCII
array.public static byte[] toAsciiByteArray(java.lang.CharSequence charSequence)
public static byte[] toRawByteArray(char[] carr)
public static char[] toRawCharArray(byte[] barr)
public static byte[] toByteArray(char[] carr)
public static byte[] toByteArray(char[] carr, java.lang.String charset)
public static char[] toCharArray(byte[] barr)
public static char[] toCharArray(byte[] barr, java.lang.String charset)
public static boolean equalsOne(char c, char[] match)
true
if characters match any character from given array,
otherwise false
public static int findFirstEqual(char[] source, int index, char[] match)
public static int findFirstEqual(char[] source, int index, char match)
public static int findFirstDiff(char[] source, int index, char[] match)
public static int findFirstDiff(char[] source, int index, char match)
public static boolean isWhitespace(char c)
true
if character is a white space (<= ' '
).
White space definition is taken from String class (see: trim()
).
This method has different results then Character#isWhitespace
."public static boolean isLowercaseAlpha(char c)
true
if specified character is lowercase ASCII.
If user uses only ASCIIs, it is much much faster.public static boolean isUppercaseAlpha(char c)
true
if specified character is uppercase ASCII.
If user uses only ASCIIs, it is much much faster.public static boolean isAlphaOrDigit(char c)
public static boolean isWordChar(char c)
public static boolean isPropertyNameChar(char c)
public static boolean isAlpha(char c)
ALPHA
set.public static boolean isDigit(char c)
DIGIT
set.public static boolean isHexDigit(char c)
public static boolean isGenericDelimiter(int c)
public static boolean isSubDelimiter(int c)
public static boolean isReserved(char c)
public static boolean isUnreserved(char c)
public static boolean isPchar(char c)
public static char toUpperAscii(char c)
public static char toLowerAscii(char c)
public static int hex2int(char c)
public static char int2hex(int i)
Copyright © 2003-present Jodd Team