public void displayResults ( boolean showMismatches , PrintStream out ) throws IOException { PrintfFormat fmt = new PrintfFormat ( "%s %3d %7.2f | %30s | %30s\n" ) ; for ( int i = 0 ; i < pairs . length ; i ++ ) { if ( pairs [ i ] != null ) { String label = pairs [ i ] . isCorrect ( ) ? "+" : "-" ; String aText = ( pairs [ i ] . getA ( ) == null ) ? "***" : pairs [ i ] . getA ( ) . unwrap ( ) ; String bText = ( pairs [ i ] . getB ( ) == null ) ? "***" : pairs [ i ] . getB ( ) . unwrap ( ) ; if ( showMismatches || "+" . equals ( label ) ) { out . print ( fmt . sprintf ( new Object [ ] { label , new Integer ( i + 1 ) , new Double ( pairs [ i ] . getDistance ( ) ) , aText , bText } ) ) ; } } } }
Show results in a simple format .