public String render ( ) { StringBuilder buf = new StringBuilder ( ) ; for ( Node node : parsed ) { if ( node instanceof Symbol ) { switch ( ( Symbol ) node ) { case MINUS : buf . append ( ' ' ) ; break ; case CURRENCY : buf . append ( CURRENCY_SYM ) ; break ; case PERCENT : buf . append ( ' ' ) ; break ; } } else if ( node instanceof Text ) { String text = ( ( Text ) node ) . text ; int len = text . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char ch = text . charAt ( i ) ; switch ( ch ) { case ' ' : case ' ' : case ' ' : case ' ' : buf . append ( ' ' ) . append ( ch ) . append ( ' ' ) ; break ; default : buf . append ( ch ) ; break ; } } } else if ( node instanceof Format ) { Format format = ( Format ) node ; format . render ( buf ) ; } } return buf . toString ( ) ; }
Render a parseable representation of this pattern .