RuleSheetParserUtil { public static String rc2name( int row, int col ){ StringBuilder sb = new StringBuilder(); int b = 26; int p = 1; if( col >= b ){ col -= b; p *= b; } if( col >= b*b ){ col -= b*b; p *= b; } while( p > 0 ){ sb.append( (char)(col/p + (int)'A') ); col %= p; p /= b; } sb.append( row + 1 ); return sb.toString(); } private  RuleSheetParserUtil(); static String getRuleName(final String ruleRow); static List<Import> getImportList(final List<String> importCells); static List<Global> getVariableList( final List<String> variableCells ); static boolean isStringMeaningTrue(String property); static String rc2name( int row, int col );  }
@Test public void testRowColumnToCellNAme() { String cellName = RuleSheetParserUtil.rc2name( 0, 0 ); assertEquals( "A1", cellName ); cellName = RuleSheetParserUtil.rc2name( 0, 10 ); assertEquals( "K1", cellName ); cellName = RuleSheetParserUtil.rc2name( 0, 42 ); assertEquals( "AQ1", cellName ); cellName = RuleSheetParserUtil.rc2name( 9, 27 ); assertEquals( "AB10", cellName ); cellName = RuleSheetParserUtil.rc2name( 99, 53 ); assertEquals( "BB100", cellName ); }