question: protected void alignRow ( String [ ] row , int [ ] maxColWidth , int [ ] maxColLead ) { int align = alignmentCode ( alignment ) ; StringBuffer s = new StringBuffer ( ) ; int columns = row . length ; for ( int column = 0 ; column < columns ; column ++ ) { s . setLength ( 0 ) ; String c = row [ column ] ; if ( alignment . equals ( RIGHT ) ) { s . append ( blanks ( maxColWidth [ column ] - s . length ( ) ) ) ; s . append ( c ) ; } else if ( alignment . equals ( DECIMAL ) ) { s . append ( blanks ( maxColLead [ column ] - lead ( c ) ) ) ; s . append ( c ) ; s . append ( blanks ( maxColWidth [ column ] - s . length ( ) ) ) ; } else if ( alignment . equals ( CENTER ) ) { s . append ( blanks ( ( maxColWidth [ column ] - c . length ( ) ) / 2 ) ) ; s . append ( c ) ; s . append ( blanks ( maxColWidth [ column ] - s . length ( ) ) ) ; } else if ( alignment . equals ( LEFT ) ) { s . append ( c ) ; s . append ( blanks ( maxColWidth [ column ] - s . length ( ) ) ) ; } else throw new InternalError ( ) ; row [ column ] = s . toString ( ) ; } }
target:  Modifies the strings the string matrix to be aligned (left,centered,right,decimal).