All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.io.PrintWriter Maven / Gradle / Ivy

The newest version!
/*

This is not an official specification document, and usage is restricted.

NOTICE


(c) 2005-2007 Sun Microsystems, Inc. All Rights Reserved.

Neither this file nor any files generated from it describe a complete specification, and they may only be used as described below. For example, no permission is given for you to incorporate this file, in whole or in part, in an implementation of a Java specification.

Sun Microsystems Inc. owns the copyright in this file and it is provided to you for informative, as opposed to normative, use. The file and any files generated from it may be used to generate other informative documentation, such as a unified set of documents of API signatures for a platform that includes technologies expressed as Java APIs. The file may also be used to produce "compilation stubs," which allow applications to be compiled and validated for such platforms.

Any work generated from this file, such as unified javadocs or compiled stub files, must be accompanied by this notice in its entirety.

This work corresponds to the API signatures of JSR 219: Foundation Profile 1.1. In the event of a discrepency between this work and the JSR 219 specification, which is available at http://www.jcp.org/en/jsr/detail?id=219, the latter takes precedence. */ package java.io; /** * Print formatted representations of objects to a text-output stream. This * class implements all of the print methods found in PrintStream. It does not * contain methods for writing raw bytes, for which a program should use * unencoded byte streams. * *

Unlike the PrintStream class, if automatic flushing is enabled it will * be done only when one of the println() methods is invoked, rather than * whenever a newline character happens to be output. The println() methods * use the platform's own notion of line separator rather than the newline * character. * *

Methods in this class never throw I/O exceptions. The client may * inquire as to whether any errors have occurred by invoking checkError(). * * @version 1.24, 02/02/00 * @author Frank Yellin * @author Mark Reinhold * @since JDK1.1 */ public class PrintWriter extends Writer { /** * The underlying character-output stream of this * PrintWriter. * * @since 1.2 */ protected Writer out; /** * Create a new PrintWriter, without automatic line flushing. * * @param out A character-output stream */ public PrintWriter(Writer out) { } /** * Create a new PrintWriter. * * @param out A character-output stream * @param autoFlush A boolean; if true, the println() methods will flush * the output buffer */ public PrintWriter(Writer out, boolean autoFlush) { } /** * Create a new PrintWriter, without automatic line flushing, from an * existing OutputStream. This convenience constructor creates the * necessary intermediate OutputStreamWriter, which will convert characters * into bytes using the default character encoding. * * @param out An output stream * * @see java.io.OutputStreamWriter#OutputStreamWriter(java.io.OutputStream) */ public PrintWriter(OutputStream out) { } /** * Create a new PrintWriter from an existing OutputStream. This * convenience constructor creates the necessary intermediate * OutputStreamWriter, which will convert characters into bytes using the * default character encoding. * * @param out An output stream * @param autoFlush A boolean; if true, the println() methods will flush * the output buffer * * @see java.io.OutputStreamWriter#OutputStreamWriter(java.io.OutputStream) */ public PrintWriter(OutputStream out, boolean autoFlush) { } /** * Flush the stream. * @see #checkError() */ public void flush() { } /** * Close the stream. * @see #checkError() */ public void close() { } /** * Flush the stream if it's not closed and check its error state. * Errors are cumulative; once the stream encounters an error, this * routine will return true on all successive calls. * * @return True if the print stream has encountered an error, either on the * underlying output stream or during a format conversion. */ public boolean checkError() { return false; } /** Indicate that an error has occurred. */ protected void setError() { } /** * Write a single character. * @param c int specifying a character to be written. */ public void write(int c) { } /** * Write a portion of an array of characters. * @param buf Array of characters * @param off Offset from which to start writing characters * @param len Number of characters to write */ public void write(char[] buf, int off, int len) { } /** * Write an array of characters. This method cannot be inherited from the * Writer class because it must suppress I/O exceptions. * @param buf Array of characters to be written */ public void write(char[] buf) { } /** * Write a portion of a string. * @param s A String * @param off Offset from which to start writing characters * @param len Number of characters to write */ public void write(String s, int off, int len) { } /** * Write a string. This method cannot be inherited from the Writer class * because it must suppress I/O exceptions. * @param s String to be written */ public void write(String s) { } /** * Print a boolean value. The string produced by {@link * java.lang.String#valueOf(boolean)} is translated into bytes * according to the platform's default character encoding, and these bytes * are written in exactly the manner of the {@link * #write(int)} method. * * @param b The boolean to be printed */ public void print(boolean b) { } /** * Print a character. The character is translated into one or more bytes * according to the platform's default character encoding, and these bytes * are written in exactly the manner of the {@link * #write(int)} method. * * @param c The char to be printed */ public void print(char c) { } /** * Print an integer. The string produced by {@link * java.lang.String#valueOf(int)} is translated into bytes according * to the platform's default character encoding, and these bytes are * written in exactly the manner of the {@link #write(int)} * method. * * @param i The int to be printed * @see java.lang.Integer#toString(int) */ public void print(int i) { } /** * Print a long integer. The string produced by {@link * java.lang.String#valueOf(long)} is translated into bytes * according to the platform's default character encoding, and these bytes * are written in exactly the manner of the {@link #write(int)} * method. * * @param l The long to be printed * @see java.lang.Long#toString(long) */ public void print(long l) { } /** * Print a floating-point number. The string produced by {@link * java.lang.String#valueOf(float)} is translated into bytes * according to the platform's default character encoding, and these bytes * are written in exactly the manner of the {@link #write(int)} * method. * * @param f The float to be printed * @see java.lang.Float#toString(float) */ public void print(float f) { } /** * Print a double-precision floating-point number. The string produced by * {@link java.lang.String#valueOf(double)} is translated into * bytes according to the platform's default character encoding, and these * bytes are written in exactly the manner of the {@link * #write(int)} method. * * @param d The double to be printed * @see java.lang.Double#toString(double) */ public void print(double d) { } /** * Print an array of characters. The characters are converted into bytes * according to the platform's default character encoding, and these bytes * are written in exactly the manner of the {@link #write(int)} * method. * * @param s The array of chars to be printed * * @throws NullPointerException If s is null */ public void print(char[] s) { } /** * Print a string. If the argument is null then the string * "null" is printed. Otherwise, the string's characters are * converted into bytes according to the platform's default character * encoding, and these bytes are written in exactly the manner of the * {@link #write(int)} method. * * @param s The String to be printed */ public void print(String s) { } /** * Print an object. The string produced by the {@link * java.lang.String#valueOf(Object)} method is translated into bytes * according to the platform's default character encoding, and these bytes * are written in exactly the manner of the {@link #write(int)} * method. * * @param obj The Object to be printed * @see java.lang.Object#toString() */ public void print(Object obj) { } /** * Terminate the current line by writing the line separator string. The * line separator string is defined by the system property * line.separator, and is not necessarily a single newline * character ('\n'). */ public void println() { } /** * Print a boolean value and then terminate the line. This method behaves * as though it invokes {@link #print(boolean)} and then * {@link #println()}. * * @param x the boolean value to be printed */ public void println(boolean x) { } /** * Print a character and then terminate the line. This method behaves as * though it invokes {@link #print(char)} and then {@link * #println()}. * * @param x the char value to be printed */ public void println(char x) { } /** * Print an integer and then terminate the line. This method behaves as * though it invokes {@link #print(int)} and then {@link * #println()}. * * @param x the int value to be printed */ public void println(int x) { } /** * Print a long integer and then terminate the line. This method behaves * as though it invokes {@link #print(long)} and then * {@link #println()}. * * @param x the long value to be printed */ public void println(long x) { } /** * Print a floating-point number and then terminate the line. This method * behaves as though it invokes {@link #print(float)} and then * {@link #println()}. * * @param x the float value to be printed */ public void println(float x) { } /** * Print a double-precision floating-point number and then terminate the * line. This method behaves as though it invokes {@link * #print(double)} and then {@link #println()}. * * @param x the double value to be printed */ public void println(double x) { } /** * Print an array of characters and then terminate the line. This method * behaves as though it invokes {@link #print(char[])} and then * {@link #println()}. * * @param x the array of char values to be printed */ public void println(char[] x) { } /** * Print a String and then terminate the line. This method behaves as * though it invokes {@link #print(String)} and then * {@link #println()}. * * @param x the String value to be printed */ public void println(String x) { } /** * Print an Object and then terminate the line. This method behaves as * though it invokes {@link #print(Object)} and then * {@link #println()}. * * @param x the Object value to be printed */ public void println(Object x) { } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy