question: private static int calculateDisplayedWidth ( String string ) { final int tabWidth = DEFAULT_TAB_WIDTH ; int column = 0 ; for ( int i = 0 ; i < string . length ( ) ; i ++ ) { if ( '\t' == string . charAt ( i ) ) { column += tabWidth - ( column % tabWidth ) ; } else { column ++ ; } } return column ; }
target:  Returns the displayed width of a string, taking in account the displayed tab width. The result can be compared against the print margin.