FlushFormat.java :  » Scripting » Kawa » gnu » text » Java Open Source

Java Open Source » Scripting » Kawa 
Kawa » gnu » text » FlushFormat.java
package gnu.text;
import java.text.FieldPosition;
import java.io.Writer;

/* A Format that does nothing except flush the destination stream. */

public class FlushFormat extends ReportFormat
{
  private static FlushFormat flush;

  public static FlushFormat getInstance()
  {
    if (flush == null)
      flush = new FlushFormat();
    return flush;
  }

  public int format(Object[] args, int start, Writer dst, FieldPosition fpos)
    throws java.io.IOException
  {
    dst.flush();
    return start;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.