Java Char Create toChar(int i)

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

Description

to Char

License

Open Source License

Declaration

private static char toChar(int i) 

Method Source Code

//package com.java2s;
/*//from   w  w  w  . jav a  2  s . c  om
 * This file is part of Dorado 7.x (http://dorado7.bsdn.org).
 * 
 * Copyright (c) 2002-2012 BSTEK Corp. All rights reserved.
 * 
 * This file is dual-licensed under the AGPLv3 (http://www.gnu.org/licenses/agpl-3.0.html) 
 * and BSDN commercial (http://www.bsdn.org/licenses) licenses.
 * 
 * If you are unsure which license is appropriate for your use, please contact the sales department
 * at http://www.bstek.com/contact.
 */

public class Main {
    private static char toChar(int i) {
        if (i >= 0 && i < 26)
            return (char) (i + 'A');
        else if (i >= 26 && i < 52)
            return (char) (i + 'a' - 26);
        else if (i >= 52 && i < 62)
            return (char) (i + '0' - 52);
        else
            throw new IllegalArgumentException("Unsupported char code [" + i + "].");
    }
}

Related

  1. toChar(byte[] bytes)
  2. toChar(byte[] si, boolean isReverseOrder)
  3. toChar(final String bitString)
  4. toChar(int c)
  5. toChar(int i)
  6. toChar(int var)
  7. toChar(int[] arr)
  8. toChar(int[] arr)
  9. toChar(Object obj)