software/test/performance/src/org/LexGrid/LexBIG/example/ScoreTerm.java
/**
	 * Display results to the user.
	 * @param result
	 */
Display results to the user.
@param result
Display results to the user . @param result
protected void printReport(BidiMap result) {
		final String Dash6  = "------";
		final String Dash10 = "----------";
		final String Dash60 = "------------------------------------------------------------";
		Formatter f = new Formatter();
		String format = "%-5.5s|%-10.10s|%-60.60s\n";
		Object[] hSep = new Object[] { Dash6, Dash10, Dash60 };
		f.format(format, hSep);
		f.format(format, new Object[] { "Score", "Code", "Term" });
		f.format(format, hSep);
		for (MapIterator items = result.inverseBidiMap().mapIterator(); items.hasNext(); ) {
			ScoredTerm st = (ScoredTerm) items.next();
			String code = (String) items.getValue();
			if (code != null && code.length() > 10)
				code = code.substring(0, 7) + "...";
			String term = st.term;
			if (term != null && term.length() < 60)
				f.format(format, new Object[] {st.score, code, term });
			else {
				String sub = term.substring(0, 60);
				f.format(format, new Object[] {st.score, code, sub });
				int begin = 60; int end = term.length();
				while (begin < end) {
					sub = term.substring(begin, Math.min(begin+60, end));
					f.format(format, new Object[] {"", "", sub });
					begin+=60;
				}
			}
		}
		Util.displayMessage(f.out().toString());
	}
protected void printReport ( BidiMap result ) { final String Dash6 = "------" ; final String Dash10 = "----------" ; final String Dash60 = "------------------------------------------------------------" ; Formatter f = new Formatter ( ) ; String format = "%-5.5s|%-10.10s|%-60.60s\n" ; Object [ ] hSep = new Object [ ] { Dash6 , Dash10 , Dash60 } ; f . format ( format , hSep ) ; f . format ( format , new Object [ ] { "Score" , "Code" , "Term" } ) ; f . format ( format , hSep ) ; for ( MapIterator items = result . inverseBidiMap ( ) . mapIterator ( ) ; items . hasNext ( ) ; ) { ScoredTerm st = ( ScoredTerm ) items . next ( ) ; String code = ( String ) items . getValue ( ) ; if ( code != null && code . length ( ) > 10 ) code = code . substring ( 0 , 7 ) + "..." ; String term = st . term ; if ( term != null && term . length ( ) < 60 ) f . format ( format , new Object [ ] { st . score , code , term } ) ; else { String sub = term . substring ( 0 , 60 ) ; f . format ( format , new Object [ ] { st . score , code , sub } ) ; int begin = 60 ; int end = term . length ( ) ; while ( begin < end ) { sub = term . substring ( begin , Math . min ( begin + 60 , end ) ) ; f . format ( format , new Object [ ] { "" , "" , sub } ) ; begin += 60 ; } } } Util . displayMessage ( f . out ( ) . toString ( ) ) ; }
Display results to the user.
Display results to the user .
// Print header.
 // Iterate over the result.
 // Evaluate code
 // Evaluate term (wrap if necessary)
