Java Integer to intToAlpha(Integer no)

Here you can find the source of intToAlpha(Integer no)

Description

convert int from 0 - ..

License

Open Source License

Parameter

Parameter Description
no a parameter

Declaration

public static String intToAlpha(Integer no) 

Method Source Code

//package com.java2s;
/**//from  w w  w  .  j a  v  a  2s .c o  m
 * @name Utils.java
 *
 *
 * @author Katrin Tebel <tebel at molgen.mpg.de>
 * @author Wei Chen
 *
 * The contents of this file are subject to the terms of either the GNU General
 * Public License Version 2 only ("GPL") or the Common Development and
 * Distribution License("CDDL") (collectively, the "License"). You may not use
 * this file except in compliance with the License. You can obtain a copy of the
 * License at http://www.netbeans.org/cddl-gplv2.html or
 * nbbuild/licenses/CDDL-GPL-2-CP. See the License for the specific language
 * governing permissions and limitations under the License. This program is
 * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE.
 */

public class Main {
    /**
     * convert int from 0 - .. to alpha
     *
     * @param no
     * @return
     */
    public static String intToAlpha(Integer no) {
        if (no > 25) {
            return intToAlpha(no - 26);
            //for(int i=65;i<=91;i++){
        }
        return String.valueOf((char) (65 + no));
    }
}

Related

  1. int2TwoChars(int i)
  2. intTo2LengthBytes(int i)
  3. intTo2UnsignedBytes(int val)
  4. intTo8HexString(int i)
  5. intToAlgebraicLoc(int loc)
  6. intToASN1(byte[] d, int idx, int val)
  7. intToBase32(int n)
  8. intToBasicType(int i, Class clazz)
  9. intToBcd(int src, int len, int flag)