Java Integer to Char intToChar(int i)

Here you can find the source of intToChar(int i)

Description

Translate between a throw height specified as an int and it's representation in the alphabet we use to denote siteswaps (0 through Z).

License

Open Source License

Declaration

public static char intToChar(int i) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from  ww  w. j  a v  a  2  s  . com*/
     * Translate between a throw height specified as an int and it's
     * representation in the alphabet we use to denote siteswaps (0 through Z).
     *
     * Example:
     * intToChar(12) returns 'c'
     */
    public static char intToChar(int i) throws Exception {
        if (i < 0 || i > 35)
            throw new Exception("int out of bounds");
        if (i < 9)
            return (char) ('0' + i);
        else
            return (char) ('a' + i - 10);
    }
}

Related

  1. intToChar(int i)
  2. intToChar(int i)
  3. intToCharacter(int i)
  4. intToChars(int value, char[] chars, int offset)