Package fr.marcwrobel.jbanking.internal
Class AsciiCharacters
java.lang.Object
fr.marcwrobel.jbanking.internal.AsciiCharacters
Operations on ASCII characters.
Code from this class is an adaptation of Apache commons-lang
CharUtils.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisAlphabetic(char c) Checks whether the character is ASCII 7 bit alphabetic.static booleanisAlphanumeric(char c) Checks whether the character is ASCII 7 bit alphabetic or numeric.static booleanisLowerAlphabetic(char c) Checks whether the character is ASCII 7 bit alphabetic lowercase.static booleanisNumeric(char c) Checks whether the character is ASCII 7 bit numeric.static booleanisSpace(char c) Checks whether the character is ASCII 7 bit space.static booleanisUpperAlphabetic(char c) Checks whether the character is ASCII 7 bit alphabetic uppercase.
-
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:
trueif between 65 and 90 or 97 and 122 inclusive,falseotherwise
-
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:
trueif between 65 and 90 inclusive,falseotherwise
-
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:
trueif between 97 and 122 inclusive,falseotherwise
-
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:
trueif between 48 and 57 inclusive,falseotherwise
-
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:
trueif between 48 and 57 or 65 and 90 or 97 and 122 inclusive,falseotherwise
-
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:
trueif equal to 32,falseotherwise
-