/** * Convert a integer to its string representation and fill with characters * on left to match the number of digits required. * If the number cannot fit in the specified digits, then the return string * is only composed of '*'. * @param value the value to be converted * @param digits the number of desired digits * @param fill the character used to fill * @return the string representing the integer * @ibm-api */ public static final String toString( int value, int digits, char fill ) { FastStringBuffer b = new FastStringBuffer(); String s = Integer.toString( value ); if( s.length()<=digits ) { b.repeat( fill, digits-s.length() ); b.append(s); } else { b.repeat( '*', digits ); } return b.toString(); } /**
/** * Convert a integer to its string representation and fill with characters * on left to match the number of digits required. * If the number cannot fit in the specified digits, then the return string * is only composed of '*'. * @param value the value to be converted * @param digits the number of desired digits * @param fill the character used to fill * @return the string representing the integer * @ibm-api */ public static final String toString( int value, int digits, char fill ) { FastStringBuffer b = new FastStringBuffer(); String s = Integer.toString( value ); if( s.length()<=digits ) { b.repeat( fill, digits-s.length() ); b.append(s); } else { b.repeat( '*', digits ); } return b.toString(); } /**
private void prtSeparator() throws Exception { FastStringBuffer b = new FastStringBuffer(); int colCount = table.getColumnCount(); for( int i=0; i<colCount; i++ ) { int sz = Math.min(table.getColumnSize(i),getMaxColSize()); b.append( '+' ); b.repeat( '-', sz ); } b.append( '+' ); println( b.toString() ); } private void prtHeader() throws Exception {
private void prtSeparator() throws Exception { FastStringBuffer b = new FastStringBuffer(); int colCount = table.getColumnCount(); for( int i=0; i<colCount; i++ ) { int sz = Math.min(table.getColumnSize(i),getMaxColSize()); b.append( '+' ); b.repeat( '-', sz ); } b.append( '+' ); println( b.toString() ); } private void prtHeader() throws Exception {