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

    Modifier and Type
    Method
    Description
    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
    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)
    Test if the current character is equal to a specific character.
    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 c)
    Check if the current char 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.
    static boolean
    isUnderscore(byte[] bytes, int index)
    Check if the current character is the ASCII character underscore 0x5F.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

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