|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.Writer | +--java.io.PrintWriter
Untamed:
Field Summary | |
private boolean |
autoFlush
|
private String |
lineSeparator
Line separator string. |
protected Writer |
out
The underlying character-output stream of this PrintWriter . |
private boolean |
trouble
|
Fields inherited from class java.io.Writer |
lock |
Constructor Summary | |
PrintWriter(OutputStream out)
Enabled: Create a new PrintWriter, without automatic line flushing, from an existing OutputStream. |
|
PrintWriter(OutputStream out,
boolean autoFlush)
Enabled: Create a new PrintWriter from an existing OutputStream. |
|
PrintWriter(Writer out)
Enabled: Create a new PrintWriter, without automatic line flushing. |
|
PrintWriter(Writer out,
boolean autoFlush)
Enabled: Create a new PrintWriter. |
Method Summary | |
boolean |
checkError()
Enabled: Flush the stream if it's not closed and check its error state. |
void |
close()
Enabled: Close the stream. |
private void |
ensureOpen()
Check to make sure that the stream has not been closed |
void |
flush()
Enabled: Flush the stream. |
private void |
newLine()
|
void |
print(boolean b)
Enabled: Print a boolean value. |
void |
print(char c)
Enabled: Print a character. |
void |
print(char[] s)
Enabled: Print an array of characters. |
void |
print(double d)
Enabled: Print a double-precision floating-point number. |
void |
print(float f)
Enabled: Print a floating-point number. |
void |
print(int i)
Enabled: Print an integer. |
void |
print(long l)
Enabled: Print a long integer. |
void |
print(Object obj)
Enabled: Print an object. |
void |
print(String s)
Enabled: Print a string. |
void |
println()
Enabled: Terminate the current line by writing the line separator string. |
void |
println(boolean x)
Enabled: Print a boolean value and then terminate the line. |
void |
println(char x)
Enabled: Print a character and then terminate the line. |
void |
println(char[] x)
Enabled: Print an array of characters and then terminate the line. |
void |
println(double x)
Enabled: Print a double-precision floating-point number and then terminate the line. |
void |
println(float x)
Enabled: Print a floating-point number and then terminate the line. |
void |
println(int x)
Enabled: Print an integer and then terminate the line. |
void |
println(long x)
Enabled: Print a long integer and then terminate the line. |
void |
println(Object x)
Enabled: Print an Object and then terminate the line. |
void |
println(String x)
Enabled: Print a String and then terminate the line. |
protected void |
setError()
Indicate that an error has occurred. |
void |
write(char[] buf)
Enabled: Write an array of characters. |
void |
write(char[] buf,
int off,
int len)
Enabled: Write a portion of an array of characters. |
void |
write(int c)
Enabled: Write a single character. |
void |
write(String s)
Enabled: Write a string. |
void |
write(String s,
int off,
int len)
Enabled: Write a portion of a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Writer out
PrintWriter
.
private boolean autoFlush
private boolean trouble
private String lineSeparator
Constructor Detail |
public PrintWriter(Writer out)
out
- A character-output streampublic PrintWriter(Writer out, boolean autoFlush)
out
- A character-output streamautoFlush
- A boolean; if true, the println() methods will flush
the output bufferpublic PrintWriter(OutputStream out)
out
- An output streamjava.io.OutputStreamWriter#OutputStreamWriter(java.io.OutputStream)
public PrintWriter(OutputStream out, boolean autoFlush)
out
- An output streamautoFlush
- A boolean; if true, the println() methods will flush
the output bufferjava.io.OutputStreamWriter#OutputStreamWriter(java.io.OutputStream)
Method Detail |
private void ensureOpen() throws IOException
IOException
public void flush()
flush
in class Writer
checkError()
public void close()
close
in class Writer
checkError()
public boolean checkError()
protected void setError()
public void write(int c)
write
in class Writer
c
- int specifying a character to be written.public void write(char[] buf, int off, int len)
write
in class Writer
buf
- Array of charactersoff
- Offset from which to start writing characterslen
- Number of characters to writepublic void write(char[] buf)
write
in class Writer
buf
- Array of characters to be writtenpublic void write(String s, int off, int len)
write
in class Writer
s
- A Stringoff
- Offset from which to start writing characterslen
- Number of characters to writepublic void write(String s)
write
in class Writer
s
- String to be writtenprivate void newLine()
public void print(boolean b)
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 write(int)
method.
b
- The boolean
to be printedpublic void print(char c)
write(int)
method.
c
- The char
to be printedpublic void print(int i)
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 write(int)
method.
i
- The int
to be printedjava.lang.Integer#toString(int)
public void print(long l)
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 write(int)
method.
l
- The long
to be printedjava.lang.Long#toString(long)
public void print(float f)
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 write(int)
method.
f
- The float
to be printedjava.lang.Float#toString(float)
public void print(double d)
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 write(int)
method.
d
- The double
to be printedjava.lang.Double#toString(double)
public void print(char[] s)
write(int)
method.
s
- The array of chars to be printed
NullPointerException
- If s
is null
public void print(String s)
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
write(int)
method.
s
- The String
to be printedpublic void print(Object obj)
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 write(int)
method.
obj
- The Object
to be printedjava.lang.Object#toString()
public void println()
line.separator
, and is not necessarily a single newline
character ('\n'
).
public void println(boolean x)
print(boolean)
and then
println()
.
x
- the boolean
value to be printedpublic void println(char x)
print(char)
and then println()
.
x
- the char
value to be printedpublic void println(int x)
print(int)
and then println()
.
x
- the int
value to be printedpublic void println(long x)
print(long)
and then
println()
.
x
- the long
value to be printedpublic void println(float x)
print(float)
and then
println()
.
x
- the float
value to be printedpublic void println(double x)
print(double)
and then println()
.
x
- the double
value to be printedpublic void println(char[] x)
print(char[])
and then
println()
.
x
- the array of char
values to be printedpublic void println(String x)
print(String)
and then
println()
.
x
- the String
value to be printedpublic void println(Object x)
print(Object)
and then
println()
.
x
- the Object
value to be printed
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |