List of utility methods to do Char to Int
int | char2int(char c) charint return (int) (c - '0'); |
int | CHAR2QUAL(char qual) This method assumes the input ASCII quality character is Sanger encoded (+33). int q = (((int) qual) - 33); if (q < 0) { return 1; } else if (255 < q) { return 255; } else { return q; |
int | charToIndex(char c) convert a cipher in the equivalent int value '0'-->0, ... switch (c) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': ... |
Integer | charToIndex(Character c) Returns the value of the Character A=0, Z=25 return Character.getNumericValue(Character.toUpperCase(c)) - 10;
|
int | charToInt(char c) Converts character to number. int val = PAD_VALUE; if (c >= 'A' && c <= 'Z') { val = c - 'A'; else if (c >= 'a' && c <= 'z') { val = c - 'a' + 26; else if (c >= '0' && c <= '9') { ... |
int | charToInt(char c) char To Int int i = 0; if (Character.isUpperCase(c)) i += 26; return i + Character.getNumericValue(c); |
int | charToInt(char c) Translate between a throw height specified as a symbol of the alphabet we use to denote siteswaps (0 through Z) and it's associated throw height as an int. int ret; if ('0' <= c && c <= '9') ret = c - '0'; else if ('a' <= c && c <= 'z') ret = c - 'a' + 10; else if ('A' <= c && c <= 'Z') ret = c - 'A' + 10; else ... |
int | charToInt(char c) char To Int try { return Integer.parseInt("" + c); } catch (NumberFormatException e) { return Integer.decode("0x" + c); |
int | charToInt(char c) Convert a character to a digit. int x = c - '0'; if (x < 0 || x > 9) throw new IllegalArgumentException("'" + (char) c + "'"); return x; |
int | twoChars2Int(char ch, char cl) Converts two characters two an int number int l = (ch << 16) + cl; return l; |