Here you can find the source of charToInt(char c)
public static int charToInt(char c) throws Exception
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w. java 2s .c o m*/ * 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. * * Examples: * charToInt('a') returns 10 */ public static int charToInt(char c) throws Exception { 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 throw new Exception("not allowed char"); return ret; } }