01: package gnu.text;
02:
03: import java.text.FieldPosition;
04: import java.io.Writer;
05:
06: /* A Format that does nothing except flush the destination stream. */
07:
08: public class FlushFormat extends ReportFormat {
09: private static FlushFormat flush;
10:
11: public static FlushFormat getInstance() {
12: if (flush == null)
13: flush = new FlushFormat();
14: return flush;
15: }
16:
17: public int format(Object[] args, int start, Writer dst,
18: FieldPosition fpos) throws java.io.IOException {
19: dst.flush();
20: return start;
21: }
22: }
|