org.apache.directory.api.util
Class Chars

java.lang.Object
  extended by org.apache.directory.api.util.Chars

public final class Chars
extends Object

Various Character methods are kept here.

Author:
Apache Directory Project

Field Summary
static boolean[] ALPHA
          <alpha> ::= [0x41-0x5A] | [0x61-0x7A]
static boolean[] ALPHA_DIGIT
          <alpha-digit> | <digit>
static boolean[] ALPHA_LOWER_CASE
          <alpha-lower-case> ::= [0x61-0x7A]
static boolean[] ALPHA_UPPER_CASE
          <alpha-upper-case> ::= [0x41-0x5A]
static boolean[] CHAR
          <alpha> | <digit> | '-'
static boolean[] DIGIT
          '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
static boolean[] HEX
          <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]
 
Constructor Summary
Chars()
           
 
Method Summary
static boolean isAlpha(byte c)
          Test if the current byte is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]
static boolean isAlpha(char c)
          Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]
static boolean isAlphaASCII(byte[] bytes, int index)
          Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]
static boolean isAlphaASCII(char[] chars, int index)
          Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]
static boolean isAlphaASCII(String string, int index)
          Test if the current character is an Alpha character : <alpha> ::= [0x41-0x5A] | [0x61-0x7A]
static boolean isAlphaDigit(String string, int index)
          Check if the current character is an 7 bits ASCII CHAR (between 0 and 127).
static boolean isAlphaDigitMinus(byte[] bytes, int index)
          Check if the current character is an 7 bits ASCII CHAR (between 0 and 127).
static boolean isAlphaDigitMinus(char[] chars, int index)
          Check if the current character is an 7 bits ASCII CHAR (between 0 and 127).
static boolean isAlphaDigitMinus(String string, int index)
          Check if the current character is an 7 bits ASCII CHAR (between 0 and 127).
static boolean isAlphaLowercaseASCII(String string, int index)
          Test if the current character is a lowercased Alpha character :
<alpha> ::= [0x61-0x7A]
static boolean isAlphaUppercaseASCII(String string, int index)
          Test if the current character is a uppercased Alpha character :
<alpha> ::= [0x61-0x7A]
static boolean isBit(String string, int index)
          Test if the current character is a bit, ie 0 or 1.
static boolean isCharASCII(char[] chars, int index, char car)
           
static boolean isCharASCII(String string, int index, char car)
          Test if the current character is equal to a specific character.
static boolean isDigit(byte car)
          Test if the current byte is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
static boolean isDigit(byte[] bytes)
          Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
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'
static boolean isDigit(char car)
          Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
static boolean isDigit(char[] chars)
          Test if the current character is a digit <digit> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
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'
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'
static boolean isHex(byte b)
          Check if the current byte is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]
static boolean isHex(byte[] bytes, int index)
          Check if the current character is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]
static boolean isHex(char[] chars, int index)
          Check if the current character is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]
static boolean isHex(String string, int index)
          Check if the current character is an Hex Char <hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]
static boolean isICharASCII(byte[] bytes, int index, char car)
          Test if the current character is equal to a specific character.
static boolean isICharASCII(String string, int index, char car)
          Test if the current character is equal to a specific character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALPHA

public static final boolean[] ALPHA
<alpha> ::= [0x41-0x5A] | [0x61-0x7A]


ALPHA_LOWER_CASE

public static final boolean[] ALPHA_LOWER_CASE
<alpha-lower-case> ::= [0x61-0x7A]


ALPHA_UPPER_CASE

public static final boolean[] ALPHA_UPPER_CASE
<alpha-upper-case> ::= [0x41-0x5A]


ALPHA_DIGIT

public static final boolean[] ALPHA_DIGIT
<alpha-digit> | <digit>


CHAR

public static final boolean[] CHAR
<alpha> | <digit> | '-'


DIGIT

public static final boolean[] DIGIT
'0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'


HEX

public static final boolean[] HEX
<hex> ::= [0x30-0x39] | [0x41-0x46] | [0x61-0x66]

Constructor Detail

Chars

public Chars()
Method Detail

isCharASCII

public static boolean isCharASCII(char[] chars,
                                  int index,
                                  char car)

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 data
index - Current position in the string
car - The character we want to compare with the current string position
Returns:
true if 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 data
index - Current position in the string
car - The character we want to compare with the current string position
Returns:
true if 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 data
index - Current position in the string
car - The character we want to compare with the current string position
Returns:
true if 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:
true if 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:
true if 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 data
index - Current position in the buffer
Returns:
true if 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 data
index - Current position in the buffer
Returns:
true if 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 data
index - Current position in the string
Returns:
true if 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 data
index - Current position in the string
Returns:
true if 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 data
index - Current position in the string
Returns:
true if 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 data
index - 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 data
index - 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 data
index - 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 data
index - Current position in the string
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 data
index - Current position in the string
Returns:
true if 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:
true if 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:
true if 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:
true if 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 data
index - Current position in the buffer
Returns:
true if 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 data
index - Current position in the buffer
Returns:
true if 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 data
index - Current position in the string
Returns:
true if 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:
true if the current character is a Digit

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:
true if 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 data
index - Current position in the buffer
Returns:
true if 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 data
index - Current position in the buffer
Returns:
true if 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 data
index - Current position in the string
Returns:
true if the current character is a Hex Char


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.