Here you can find the source of intToAlpha(Integer no)
Parameter | Description |
---|---|
no | a parameter |
public static String intToAlpha(Integer no)
//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)); } }