Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

java::io::PrintWriter Class Reference

Print formatted representations of objects to a text-output stream. More...

#include <java_io_PrintWriter.h>

Inheritance diagram for java::io::PrintWriter:

Inheritance graph
[legend]
Collaboration diagram for java::io::PrintWriter:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  xmogDefaultFlags = xmog_base::GLOBAL, xmogMajorVersion = 3, xmogMinorVersion = 2, xmogPatchVersion = 9,
  xmogBuildNumber = 2047
}
typedef ::xmog_java_array_template<
::java::io::PrintWriter
array1D
typedef ::xmog_java_array_template<
::xmog_java_array_template<
::java::io::PrintWriter > > 
array2D

Public Member Functions

virtual bool checkError (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Flush the stream if it's not closed and check its error state.
virtual void close (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Close the stream.
virtual void flush (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Flush the stream.
virtual void print (const ::xmog_java_char_array &s,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print an array of characters.
virtual void print (const ::java::lang::Object &obj,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print an object.
virtual void print (const ::java::lang::String &s,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a string.
virtual void print (jdouble d,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a double-precision floating-point number.
virtual void print (jfloat f,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a floating-point number.
virtual void print (jlong l,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a long integer.
virtual void print (jchar c,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a character.
virtual void print (bool b,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a boolean value.
virtual void print (jint i,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print an integer.
virtual void println (const ::xmog_java_char_array &x,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print an array of characters and then terminate the line.
virtual void println (const ::java::lang::String &x,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a String and then terminate the line.
virtual void println (const ::java::lang::Object &x,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print an Object and then terminate the line.
virtual void println (jdouble x,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a double-precision floating-point number and then terminate the line.
virtual void println (jfloat x,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a floating-point number and then terminate the line.
virtual void println (jlong x,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a long integer and then terminate the line.
virtual void println (jchar x,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a character and then terminate the line.
virtual void println (bool x,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print a boolean value and then terminate the line.
virtual void println (jint x,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Print an integer and then terminate the line.
virtual void println (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Terminate the current line by writing the line separator string.
 PrintWriter (const ::java::io::OutputStream &out, bool autoFlush,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Create a new PrintWriter from an existing OutputStream.
 PrintWriter (const ::java::io::Writer &out, bool autoFlush,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Create a new PrintWriter.
 PrintWriter (const ::java::io::OutputStream &out,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Create a new PrintWriter, without automatic line flushing, from an existing OutputStream.
 PrintWriter (const ::java::io::Writer &out,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Create a new PrintWriter, without automatic line flushing.
virtual void write (const ::xmog_java_char_array &buf, jint off, jint len,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Write a portion of an array of characters.
virtual void write (const ::java::lang::String &s, jint off, jint len,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Write a portion of a string.
virtual void write (const ::xmog_java_char_array &buf,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Write an array of characters.
virtual void write (const ::java::lang::String &s,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Write a string.
virtual void write (jint c,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Write a single character.

Detailed Description

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().

Author:
Frank Yellin

Mark Reinhold


Constructor & Destructor Documentation

java::io::PrintWriter::PrintWriter const ::java::io::Writer out,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Create a new PrintWriter, without automatic line flushing.

Parameters:
out A character-output stream
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.

java::io::PrintWriter::PrintWriter const ::java::io::OutputStream out,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

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.

Parameters:
out An output stream
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.

java::io::PrintWriter::PrintWriter const ::java::io::Writer out,
bool  autoFlush,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Create a new PrintWriter.

Parameters:
out A character-output stream
autoFlush A boolean; if true, the println() methods will flush the output buffer
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.

java::io::PrintWriter::PrintWriter const ::java::io::OutputStream out,
bool  autoFlush,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

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.

Parameters:
out An output stream
autoFlush A boolean; if true, the println() methods will flush the output buffer
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.


Member Function Documentation

virtual bool java::io::PrintWriter::checkError ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
True if the print stream has encountered an error, either on the underlying output stream or during a format conversion.

virtual void java::io::PrintWriter::close ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Close the stream.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::io::Writer.

virtual void java::io::PrintWriter::flush ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Flush the stream.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::io::Writer.

virtual void java::io::PrintWriter::print const ::xmog_java_char_array s,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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 method.

Parameters:
s The array of chars to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::print const ::java::lang::Object obj,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print an object.

The string produced by the method is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the method.

Parameters:
obj The Object to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::print const ::java::lang::String s,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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 method.

Parameters:
s The String to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::print jdouble  d,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print a double-precision floating-point number.

The string produced by is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the method.

Parameters:
d The double to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::print jfloat  f,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print a floating-point number.

The string produced by is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the method.

Parameters:
f The float to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::print jlong  l,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print a long integer.

The string produced by is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the method.

Parameters:
l The long to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::print jchar  c,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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 method.

Parameters:
c The char to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::print bool  b,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print a boolean value.

The string produced by is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the method.

Parameters:
b The boolean to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::print jint  i,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print an integer.

The string produced by is translated into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the method.

Parameters:
i The int to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::println const ::xmog_java_char_array x,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print an array of characters and then terminate the line.

This method behaves as though it invokes and then .

Parameters:
x the array of char values to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::println const ::java::lang::String x,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print a String and then terminate the line.

This method behaves as though it invokes and then .

Parameters:
x the String value to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::println const ::java::lang::Object x,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print an Object and then terminate the line.

This method behaves as though it invokes and then .

Parameters:
x the Object value to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::println jdouble  x,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print a double-precision floating-point number and then terminate the line.

This method behaves as though it invokes and then .

Parameters:
x the double value to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::println jfloat  x,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print a floating-point number and then terminate the line.

This method behaves as though it invokes and then .

Parameters:
x the float value to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::println jlong  x,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print a long integer and then terminate the line.

This method behaves as though it invokes and then .

Parameters:
x the long value to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::println jchar  x,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print a character and then terminate the line.

This method behaves as though it invokes and then .

Parameters:
x the char value to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::println bool  x,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print a boolean value and then terminate the line.

This method behaves as though it invokes and then .

Parameters:
x the boolean value to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::println jint  x,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Print an integer and then terminate the line.

This method behaves as though it invokes and then .

Parameters:
x the int value to be printed
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::println ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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 ('
'
).

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void java::io::PrintWriter::write const ::xmog_java_char_array buf,
jint  off,
jint  len,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Write a portion of an array of characters.

Parameters:
buf Array of characters
off Offset from which to start writing characters
len Number of characters to write
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::io::Writer.

virtual void java::io::PrintWriter::write const ::java::lang::String s,
jint  off,
jint  len,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Write a portion of a string.

Parameters:
s A String
off Offset from which to start writing characters
len Number of characters to write
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::io::Writer.

virtual void java::io::PrintWriter::write const ::xmog_java_char_array buf,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Write an array of characters.

This method cannot be inherited from the Writer class because it must suppress I/O exceptions.

Parameters:
buf Array of characters to be written
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::io::Writer.

virtual void java::io::PrintWriter::write const ::java::lang::String s,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Write a string.

This method cannot be inherited from the Writer class because it must suppress I/O exceptions.

Parameters:
s String to be written
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::io::Writer.

virtual void java::io::PrintWriter::write jint  c,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Write a single character.

Parameters:
c int specifying a character to be written.
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented from java::io::Writer.


The documentation for this class was generated from the following file:
Generated on Fri Jun 16 10:19:17 2006 for JMS Courier for C++ by  doxygen 1.4.1