java.util.Formatter.flush()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(202)

本文整理了Java中java.util.Formatter.flush()方法的一些代码示例,展示了Formatter.flush()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Formatter.flush()方法的具体详情如下:
包路径:java.util.Formatter
类名称:Formatter
方法名:flush

Formatter.flush介绍

[英]Flushes the Formatter. If the output destination is Flushable, then the method flush() will be called on that destination.
[中]刷新格式化程序。如果输出目标是可刷新的,则将在该目标上调用flush()方法。

代码示例

代码示例来源:origin: org.codehaus.groovy/groovy

private static void callWithFormatter(Closure closure, Formatter formatter) {
  try {
    closure.call(formatter);
  } finally {
    formatter.flush();
    formatter.close();
  }
}

代码示例来源:origin: robovm/robovm

/**
 * Writes a formatted string to the console using
 * the specified format string and arguments.
 *
 * @param format the format string (see {@link java.util.Formatter#format})
 * @param args
 *            the list of arguments passed to the formatter. If there are
 *            more arguments than required by {@code format},
 *            additional arguments are ignored.
 * @return the console instance.
 */
public Console format(String format, Object... args) {
  Formatter f = new Formatter(writer);
  f.format(format, args);
  f.flush();
  return this;
}

代码示例来源:origin: biz.aQute.bnd/bndlib

public MarkdownFormatter flush() {
    f.flush();
    return this;
  }
}

代码示例来源:origin: biz.aQute.bnd/bnd

public MarkdownFormatter flush() {
    f.flush();
    return this;
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.repository

public MarkdownFormatter flush() {
    f.flush();
    return this;
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

/**
 */
@Override
public void trace(String s, Object... args) {
  if (trace && out != null) {
    out.format("# " + s + "%n", args);
    out.flush();
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.repository

/**
 */
@Override
public void trace(String s, Object... args) {
  if (trace && out != null) {
    out.format("# " + s + "%n", args);
    out.flush();
  }
}

代码示例来源:origin: org.osgi/osgi.enroute.web.simple.provider

public void trace(String s, Object... args) {
  if (trace && out != null) {
    out.format("# " + s + "%n", args);
    out.flush();
  }
}

代码示例来源:origin: biz.aQute/bndlib

public void trace(String s, Object... args) {
  if (trace && out != null) {
    out.format("# " + s + "%n", args);
    out.flush();
  }
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

/**
 */
@Override
public void trace(String s, Object... args) {
  if (trace && out != null) {
    out.format("# " + s + "%n", args);
    out.flush();
  }
}

代码示例来源:origin: com.linkedin.pegasus/data

@Override
 public String toString()
 {
  String fieldSeparator = getFieldSeparator();
  StringBuilder sb = new StringBuilder();
  Formatter formatter = new Formatter(sb);
  format(formatter, fieldSeparator);
  formatter.flush();
  formatter.close();
  return sb.toString();
 }
}

代码示例来源:origin: biz.aQute/bndlib

private String help(Object target, String cmd, Class< ? extends Options> type) throws Exception {
  StringBuilder sb = new StringBuilder();
  Formatter f = new Formatter(sb);
  if (cmd == null)
    help(f, target);
  else if (type == null)
    help(f, target, cmd);
  else
    help(f, target, cmd, type);
  f.flush();
  justif.wrap(sb);
  return sb.toString();
}

代码示例来源:origin: biz.aQute/bndlib

/**
 * Report the errors and warnings
 */
public void report(Appendable out) {
  Formatter f = new Formatter(out);
  report("Error", getErrors(), f);
  report("Warning", getWarnings(), f);
  f.flush();
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib

/**
 * Report the errors and warnings
 */
public void report(Appendable out) {
  Formatter f = new Formatter(out);
  report("Error", getErrors(), f);
  report("Warning", getWarnings(), f);
  f.flush();
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.repository

/**
 * Report the errors and warnings
 */
public void report(Appendable out) {
  Formatter f = new Formatter(out);
  report("Error", getErrors(), f);
  report("Warning", getWarnings(), f);
  f.flush();
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

/**
 * Report the errors and warnings
 */
public void report(Appendable out) {
  Formatter f = new Formatter(out);
  report("Error", getErrors(), f);
  report("Warning", getWarnings(), f);
  f.flush();
}

代码示例来源:origin: biz.aQute.bnd/bnd

/**
 * Report the errors and warnings
 */
public void report(Appendable out) {
  Formatter f = new Formatter(out);
  report("Error", getErrors(), f);
  report("Warning", getWarnings(), f);
  f.flush();
}

代码示例来源:origin: org.osgi/osgi.enroute.configurer.simple.provider

/**
 * Report the errors and warnings
 */
public void report(Appendable out) {
  Formatter f = new Formatter(out);
  report("Error", getErrors(), f);
  report("Warning", getWarnings(), f);
  f.flush();
}

代码示例来源:origin: biz.aQute.bnd/bndlib

/**
 * Report the errors and warnings
 */
public void report(Appendable out) {
  Formatter f = new Formatter(out);
  report("Error", getErrors(), f);
  report("Warning", getWarnings(), f);
  f.flush();
}

代码示例来源:origin: Unidata/thredds

CodeTableGen(String filename) throws IOException {
 out = new Formatter(System.out);
 dataIS = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
 getNextLine();
 int count = 0;
 while (readCodeTable() && count < 100) {
  out.format("%d ", count);
  count++;
 }
 out.flush();
 dataIS.close();
}

相关文章