KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > text > FlushFormat


1 package gnu.text;
2 import java.text.FieldPosition JavaDoc;
3 import java.io.Writer JavaDoc;
4
5 /* A Format that does nothing except flush the destination stream. */
6
7 public class FlushFormat extends ReportFormat
8 {
9   private static FlushFormat flush;
10
11   public static FlushFormat getInstance()
12   {
13     if (flush == null)
14       flush = new FlushFormat();
15     return flush;
16   }
17
18   public int format(Object JavaDoc[] args, int start, Writer JavaDoc dst, FieldPosition JavaDoc fpos)
19     throws java.io.IOException JavaDoc
20   {
21     dst.flush();
22     return start;
23   }
24 }
25
Popular Tags