public void print ( String separator , String terminator ) { for ( int i = 0 ; i < maxColumnLength . size ( ) ; i ++ ) { maxColumnLength . set ( i , ( ( ( maxColumnLength . get ( i ) / TAB_SIZE ) + 1 ) * TAB_SIZE ) ) ; } for ( int r = 0 ; r < rows . size ( ) ; r ++ ) { String [ ] s = rows . get ( r ) ; for ( int i = 0 ; i < s . length ; i ++ ) { out . print ( s [ i ] ) ; if ( i < s . length - 1 ) { for ( int l = ( s [ i ] == null ? 0 : s [ i ] . length ( ) ) ; l < maxColumnLength . get ( i ) ; l ++ ) { out . print ( ' ' ) ; } } } if ( separator != null && r < rows . size ( ) - 1 ) { out . println ( separator ) ; } else if ( terminator != null && r == rows . size ( ) - 1 ) { out . println ( terminator ) ; } else { out . println ( ) ; } } }
Outputs the block with the given separator appended to each line except the last and the given terminator appended to the last line .