Package org.apache.directory.api.util
Class Chars
- java.lang.Object
-
- org.apache.directory.api.util.Chars
-
public final class Chars extends Object
Various Character methods are kept here.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisAlpha(byte c)Test if the current byte is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]static booleanisAlpha(char c)Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]static booleanisAlphaASCII(byte[] bytes, int index)Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]static booleanisAlphaASCII(char[] chars, int index)Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]static booleanisAlphaASCII(String string, int index)Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]static booleanisAlphaDigit(String string, int index)Check if the current character is an 7 bits ASCII CHAR (between 0 and 127).static booleanisAlphaDigitMinus(byte[] bytes, int index)Check if the current character is an 7 bits ASCII CHAR (between 0 and 127).static booleanisAlphaDigitMinus(char c)Check if the current character is an 7 bits ASCII CHAR (between 0 and 127).static booleanisAlphaDigitMinus(char[] chars, int index)Check if the current character is an 7 bits ASCII CHAR (between 0 and 127).static booleanisAlphaDigitMinus(String string, int index)Check if the current character is an 7 bits ASCII CHAR (between 0 and 127).static booleanisAlphaLowercaseASCII(String string, int index)Test if the current character is a lowercased Alpha character :
<alpha> ::= [0x61-0x7A]static booleanisAlphaUppercaseASCII(String string, int index)Test if the current character is a uppercased Alpha character :
<alpha> ::= [0x61-0x7A]static booleanisBit(String string, int index)Test if the current character is a bit, ie 0 or 1.static booleanisCharASCII(char[] chars, int index, char car)Test if the current character is equal to a specific character.static booleanisCharASCII(String string, int index, char car)Test if the current character is equal to a specific character.static booleanisDigit(byte car)Test if the current byte is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'static booleanisDigit(byte[] bytes)Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'static booleanisDigit(byte[] bytes, int index)Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'static booleanisDigit(char car)Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'static booleanisDigit(char[] chars)Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'static booleanisDigit(char[] chars, int index)Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'static booleanisDigit(String string, int index)Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'static booleanisHex(byte b)Check if the current byte is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]static booleanisHex(byte[] bytes, int index)Check if the current character is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]static booleanisHex(char c)Check if the current char is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]static booleanisHex(char[] chars, int index)Check if the current character is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]static booleanisHex(String string, int index)Check if the current character is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]static booleanisICharASCII(byte[] bytes, int index, char car)Test if the current character is equal to a specific character.static booleanisICharASCII(String string, int index, char car)Test if the current character is equal to a specific character.static booleanisUnderscore(byte[] bytes, int index)Check if the current character is the ASCII character underscore 0x5F.
-
-
-
Method Detail
-
isCharASCII
public static boolean isCharASCII(char[] chars, int index, char car)Test if the current character is equal to a specific character.- Parameters:
chars- The buffer which contains the dataindex- Current position in the buffercar- The character we want to compare with the current buffer position- Returns:
trueif the current character equals the given character.
-
isCharASCII
public static boolean isCharASCII(String string, int index, char car)
Test if the current character is equal to a specific character.- Parameters:
string- The String which contains the dataindex- Current position in the stringcar- The character we want to compare with the current string position- Returns:
trueif the current character equals the given character.
-
isICharASCII
public static boolean isICharASCII(String string, int index, char car)
Test if the current character is equal to a specific character.- Parameters:
string- The String which contains the dataindex- Current position in the stringcar- The character we want to compare with the current string position- Returns:
trueif the current character equals the given character.
-
isICharASCII
public static boolean isICharASCII(byte[] bytes, int index, char car)Test if the current character is equal to a specific character.- Parameters:
bytes- The String which contains the dataindex- Current position in the stringcar- The character we want to compare with the current string position- Returns:
trueif the current character equals the given character.
-
isAlpha
public static boolean isAlpha(byte c)
Test if the current byte is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]- Parameters:
c- The byte to test- Returns:
trueif the byte is an Alpha character
-
isAlpha
public static boolean isAlpha(char c)
Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]- Parameters:
c- The char to test- Returns:
trueif the character is an Alpha character
-
isAlphaASCII
public static boolean isAlphaASCII(byte[] bytes, int index)Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]- Parameters:
bytes- The buffer which contains the dataindex- Current position in the buffer- Returns:
trueif the current character is an Alpha character
-
isAlphaASCII
public static boolean isAlphaASCII(char[] chars, int index)Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]- Parameters:
chars- The buffer which contains the dataindex- Current position in the buffer- Returns:
trueif the current character is an Alpha character
-
isAlphaASCII
public static boolean isAlphaASCII(String string, int index)
Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]- Parameters:
string- The string which contains the dataindex- Current position in the string- Returns:
trueif the current character is an Alpha character
-
isAlphaLowercaseASCII
public static boolean isAlphaLowercaseASCII(String string, int index)
Test if the current character is a lowercased Alpha character :
<alpha> ::= [0x61-0x7A]- Parameters:
string- The string which contains the dataindex- Current position in the string- Returns:
trueif the current character is a lower Alpha character
-
isAlphaUppercaseASCII
public static boolean isAlphaUppercaseASCII(String string, int index)
Test if the current character is a uppercased Alpha character :
<alpha> ::= [0x61-0x7A]- Parameters:
string- The string which contains the dataindex- Current position in the string- Returns:
trueif the current character is a lower Alpha character
-
isAlphaDigit
public static boolean isAlphaDigit(String string, int index)
Check if the current character is an 7 bits ASCII CHAR (between 0 and 127). <char> ::= <alpha> | <digit>- Parameters:
string- The string which contains the dataindex- Current position in the string- Returns:
- The position of the next character, if the current one is a CHAR.
-
isAlphaDigitMinus
public static boolean isAlphaDigitMinus(byte[] bytes, int index)Check if the current character is an 7 bits ASCII CHAR (between 0 and 127). <char> ::= <alpha> | <digit> | '-'- Parameters:
bytes- The buffer which contains the dataindex- Current position in the buffer- Returns:
- The position of the next character, if the current one is a CHAR.
-
isAlphaDigitMinus
public static boolean isAlphaDigitMinus(char[] chars, int index)Check if the current character is an 7 bits ASCII CHAR (between 0 and 127). <char> ::= <alpha> | <digit> | '-'- Parameters:
chars- The buffer which contains the dataindex- Current position in the buffer- Returns:
- The position of the next character, if the current one is a CHAR.
-
isAlphaDigitMinus
public static boolean isAlphaDigitMinus(String string, int index)
Check if the current character is an 7 bits ASCII CHAR (between 0 and 127). <char> ::= <alpha> | <digit> | '-'- Parameters:
string- The string which contains the dataindex- Current position in the string- Returns:
- The position of the next character, if the current one is a CHAR.
-
isAlphaDigitMinus
public static boolean isAlphaDigitMinus(char c)
Check if the current character is an 7 bits ASCII CHAR (between 0 and 127). <char> ::= <alpha> | <digit> | '-'- Parameters:
c- The char we want to check- Returns:
- The position of the next character, if the current one is a CHAR.
-
isBit
public static boolean isBit(String string, int index)
Test if the current character is a bit, ie 0 or 1.- Parameters:
string- The String which contains the dataindex- Current position in the string- Returns:
trueif the current character is a bit (0 or 1)
-
isDigit
public static boolean isDigit(byte[] bytes)
Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'- Parameters:
bytes- The buffer which contains the data- Returns:
trueif the current character is a Digit
-
isDigit
public static boolean isDigit(char car)
Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'- Parameters:
car- the character to test- Returns:
trueif the character is a Digit
-
isDigit
public static boolean isDigit(byte car)
Test if the current byte is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'- Parameters:
car- the byte to test- Returns:
trueif the character is a Digit
-
isDigit
public static boolean isDigit(byte[] bytes, int index)Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'- Parameters:
bytes- The buffer which contains the dataindex- Current position in the buffer- Returns:
trueif the current character is a Digit
-
isDigit
public static boolean isDigit(char[] chars, int index)Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'- Parameters:
chars- The buffer which contains the dataindex- Current position in the buffer- Returns:
trueif the current character is a Digit
-
isDigit
public static boolean isDigit(String string, int index)
Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'- Parameters:
string- The string which contains the dataindex- Current position in the string- Returns:
trueif the current character is a Digit
-
isDigit
public static boolean isDigit(char[] chars)
Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'- Parameters:
chars- The buffer which contains the data- Returns:
trueif the current character is a Digit
-
isHex
public static boolean isHex(char c)
Check if the current char is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]- Parameters:
c- The char we want to check- Returns:
trueif the current char is a Hex char
-
isHex
public static boolean isHex(byte b)
Check if the current byte is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]- Parameters:
b- The byte we want to check- Returns:
trueif the current byte is a Hex byte
-
isHex
public static boolean isHex(byte[] bytes, int index)Check if the current character is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]- Parameters:
bytes- The buffer which contains the dataindex- Current position in the buffer- Returns:
trueif the current character is a Hex Char
-
isHex
public static boolean isHex(char[] chars, int index)Check if the current character is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]- Parameters:
chars- The buffer which contains the dataindex- Current position in the buffer- Returns:
trueif the current character is a Hex Char
-
isHex
public static boolean isHex(String string, int index)
Check if the current character is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]- Parameters:
string- The string which contains the dataindex- Current position in the string- Returns:
trueif the current character is a Hex Char
-
isUnderscore
public static boolean isUnderscore(byte[] bytes, int index)Check if the current character is the ASCII character underscore 0x5F.- Parameters:
bytes- The buffer which contains the dataindex- Current position in the buffer- Returns:
trueif the current character is a the underscore
-
-