Class AsciiCharacters

java.lang.Object
fr.marcwrobel.jbanking.internal.AsciiCharacters

public class AsciiCharacters extends Object
Operations on ASCII characters.

Code from this class is an adaptation of Apache commons-lang CharUtils.

  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isAlphabetic(char c)
    Checks whether the character is ASCII 7 bit alphabetic.
    static boolean
    Checks whether the character is ASCII 7 bit alphabetic or numeric.
    static boolean
    Checks whether the character is ASCII 7 bit alphabetic lowercase.
    static boolean
    isNumeric(char c)
    Checks whether the character is ASCII 7 bit numeric.
    static boolean
    isSpace(char c)
    Checks whether the character is ASCII 7 bit space.
    static boolean
    Checks whether the character is ASCII 7 bit alphabetic uppercase.

    Methods inherited from class java.lang.Object

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

    • isAlphabetic

      public static boolean isAlphabetic(char c)

      Checks whether the character is ASCII 7 bit alphabetic.

         AsciiCharacters.isAlphabetic('a')  = true
         AsciiCharacters.isAlphabetic('A')  = true
         AsciiCharacters.isAlphabetic('3')  = false
         AsciiCharacters.isAlphabetic('-')  = false
         AsciiCharacters.isAlphabetic('\n') = false
         AsciiCharacters.isAlphabetic('©') = false
       
      Parameters:
      c - the character to check
      Returns:
      true if between 65 and 90 or 97 and 122 inclusive, false otherwise
    • isUpperAlphabetic

      public static boolean isUpperAlphabetic(char c)

      Checks whether the character is ASCII 7 bit alphabetic uppercase.

         AsciiCharacters.isUpperAlphabetic('a')  = false
         AsciiCharacters.isUpperAlphabetic('A')  = true
         AsciiCharacters.isUpperAlphabetic('3')  = false
         AsciiCharacters.isUpperAlphabetic('-')  = false
         AsciiCharacters.isUpperAlphabetic('\n') = false
         AsciiCharacters.isUpperAlphabetic('©') = false
       
      Parameters:
      c - the character to check
      Returns:
      true if between 65 and 90 inclusive, false otherwise
    • isLowerAlphabetic

      public static boolean isLowerAlphabetic(char c)

      Checks whether the character is ASCII 7 bit alphabetic lowercase.

         AsciiCharacters.isLowerAlphabetic('a')  = true
         AsciiCharacters.isLowerAlphabetic('A')  = false
         AsciiCharacters.isLowerAlphabetic('3')  = false
         AsciiCharacters.isLowerAlphabetic('-')  = false
         AsciiCharacters.isLowerAlphabetic('\n') = false
         AsciiCharacters.isLowerAlphabetic('©') = false
       
      Parameters:
      c - the character to check
      Returns:
      true if between 97 and 122 inclusive, false otherwise
    • isNumeric

      public static boolean isNumeric(char c)

      Checks whether the character is ASCII 7 bit numeric.

         AsciiCharacters.isNumeric('a')  = false
         AsciiCharacters.isNumeric('A')  = false
         AsciiCharacters.isNumeric('3')  = true
         AsciiCharacters.isNumeric('-')  = false
         AsciiCharacters.isNumeric('\n') = false
         AsciiCharacters.isNumeric('©') = false
       
      Parameters:
      c - the character to check
      Returns:
      true if between 48 and 57 inclusive, false otherwise
    • isAlphanumeric

      public static boolean isAlphanumeric(char c)

      Checks whether the character is ASCII 7 bit alphabetic or numeric.

         AsciiCharacters.isAlphanumeric('a')  = true
         AsciiCharacters.isAlphanumeric('A')  = true
         AsciiCharacters.isAlphanumeric('3')  = true
         AsciiCharacters.isAlphanumeric('-')  = false
         AsciiCharacters.isAlphanumeric('\n') = false
         AsciiCharacters.isAlphanumeric('©') = false
       
      Parameters:
      c - the character to check
      Returns:
      true if between 48 and 57 or 65 and 90 or 97 and 122 inclusive, false otherwise
    • isSpace

      public static boolean isSpace(char c)

      Checks whether the character is ASCII 7 bit space.

         AsciiCharacters.isSpace(' ')  = true
         AsciiCharacters.isSpace('A')  = false
         AsciiCharacters.isSpace('3')  = false
         AsciiCharacters.isSpace('-')  = false
         AsciiCharacters.isSpace('\n') = false
         AsciiCharacters.isSpace('©') = false
       
      Parameters:
      c - the character to check
      Returns:
      true if equal to 32, false otherwise