diff options
author | Tom Tromey <tromey@gcc.gnu.org> | 2007-01-09 19:58:05 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2007-01-09 19:58:05 +0000 |
commit | 97b8365cafc3a344a22d3980b8ed885f5c6d8357 (patch) | |
tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/java/io/PrintWriter.java | |
parent | c648dedbde727ca3f883bb5fd773aa4af70d3369 (diff) | |
download | gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.zip gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.tar.gz gcc-97b8365cafc3a344a22d3980b8ed885f5c6d8357.tar.bz2 |
Merged gcj-eclipse branch to trunk.
From-SVN: r120621
Diffstat (limited to 'libjava/classpath/java/io/PrintWriter.java')
-rw-r--r-- | libjava/classpath/java/io/PrintWriter.java | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/libjava/classpath/java/io/PrintWriter.java b/libjava/classpath/java/io/PrintWriter.java index 5667e70..5b4294c 100644 --- a/libjava/classpath/java/io/PrintWriter.java +++ b/libjava/classpath/java/io/PrintWriter.java @@ -1,5 +1,5 @@ /* PrintWriter.java -- prints primitive values and objects to a stream as text - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation + Copyright (C) 1998, 1999, 2000, 2001, 2005 Free Software Foundation This file is part of GNU Classpath. @@ -37,6 +37,9 @@ exception statement from your version. */ package java.io; +import java.util.Locale; +import java.util.Formatter; + /* Written using "Java Class Libraries", 2nd edition, plus online * API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. @@ -636,5 +639,52 @@ public class PrintWriter extends Writer { write(str, 0, str.length()); } + + /** @since 1.5 */ + public PrintWriter append(char c) + { + write(c); + return this; + } + + /** @since 1.5 */ + public PrintWriter append(CharSequence cs) + { + write(cs == null ? "null" : cs.toString()); + return this; + } + + /** @since 1.5 */ + public PrintWriter append(CharSequence cs, int start, int end) + { + write(cs == null ? "null" : cs.subSequence(start, end).toString()); + return this; + } + + /** @since 1.5 */ + public PrintWriter printf(String format, Object... args) + { + return format(format, args); + } + + /** @since 1.5 */ + public PrintWriter printf(Locale locale, String format, Object... args) + { + return format(locale, format, args); + } + + /** @since 1.5 */ + public PrintWriter format(String format, Object... args) + { + return format(Locale.getDefault(), format, args); + } + + /** @since 1.5 */ + public PrintWriter format(Locale locale, String format, Object... args) + { + Formatter f = new Formatter(this, locale); + f.format(format, args); + return this; + } } |