Java Utililty Methods Char to Int

List of utility methods to do Char to Int

Description

The list of methods to do Char to Int are organized into topic(s).

Method

intchar2int(char c)
charint
return (int) (c - '0');
intCHAR2QUAL(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;
intcharToIndex(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':
...
IntegercharToIndex(Character c)
Returns the value of the Character A=0, Z=25
return Character.getNumericValue(Character.toUpperCase(c)) - 10;
intcharToInt(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') {
...
intcharToInt(char c)
char To Int
int i = 0;
if (Character.isUpperCase(c))
    i += 26;
return i + Character.getNumericValue(c);
intcharToInt(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
...
intcharToInt(char c)
char To Int
try {
    return Integer.parseInt("" + c);
} catch (NumberFormatException e) {
    return Integer.decode("0x" + c);
intcharToInt(char c)
Convert a character to a digit.
int x = c - '0';
if (x < 0 || x > 9)
    throw new IllegalArgumentException("'" + (char) c + "'");
return x;
inttwoChars2Int(char ch, char cl)
Converts two characters two an int number
int l = (ch << 16) + cl;
return l;