com.ibm.dse.tools.workbench.gui
Class ConsolePrintStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--java.io.FilterOutputStream
              |
              +--java.io.PrintStream
                    |
                    +--com.ibm.dse.tools.workbench.gui.ConsolePrintStream

public abstract class ConsolePrintStream
extends java.io.PrintStream

This class provides a PrintStream redirected to the GraphicConsole object.


Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
ConsolePrintStream(java.io.OutputStream out)
          This constructor creates a ConsoleErrorPrintStream object without autoflush.
ConsolePrintStream(java.io.OutputStream out, boolean autoFlush)
          This constructor creates a ConsoleErrorPrintStream object with the given OutputStream and autoflush option.
 
Method Summary
 boolean checkError()
          Flush the stream and check its error state.
 void close()
          Close the stream.
 void flush()
          Flush the stream.
 void print(boolean b)
          Print a boolean value.
 void print(char c)
          Print a character.
 void print(char[] s)
          Print an array of characters.
 void print(double d)
          Print a double-precision floating-point number.
 void print(float f)
          Print a floating-point number.
 void print(int i)
          Print an integer.
 void print(long l)
          Print a long integer.
 void print(java.lang.Object obj)
          Print an object.
 void print(java.lang.String s)
          Print a string.
 void println()
          Finish the current line by writing a line separator.
 void println(boolean x)
          Print a boolean, and then finish the line.
 void println(char x)
          Print a character, and then finish the line.
 void println(char[] x)
          Print an array of characters, and then finish the line.
 void println(double x)
          Print a double, and then finish the line.
 void println(float x)
          Print a float, and then finish the line.
 void println(int x)
          Print an integer, and then finish the line.
 void println(long x)
          Print a long, and then finish the line.
 void println(java.lang.Object x)
          Print an Object, and then finish the line.
 void println(java.lang.String x)
          Print a String, and then finish the line.
 void write(byte[] buf, int off, int len)
          Write a portion of a byte array, blocking if necessary.
 void write(int b)
          Write a byte, blocking if necessary.
abstract  void write(java.lang.String s)
          This method writes a String in the PrintStream.
 
Methods inherited from class java.io.PrintStream
setError
 
Methods inherited from class java.io.FilterOutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsolePrintStream

public ConsolePrintStream(java.io.OutputStream out)
This constructor creates a ConsoleErrorPrintStream object without autoflush.
Parameters:
out - java.io.OutputStream

ConsolePrintStream

public ConsolePrintStream(java.io.OutputStream out,
                          boolean autoFlush)
This constructor creates a ConsoleErrorPrintStream object with the given OutputStream and autoflush option.
Parameters:
out - java.io.OutputStream
autoFlush - boolean
Method Detail

checkError

public boolean checkError()
Flush the stream and check its error state. Errors are cumulative; once the stream encounters an error, this routine will continue to return true on all successive calls.
Overrides:
checkError in class java.io.PrintStream
Returns:
True if the print stream has encountered an error, either on the underlying output stream or during a format conversion, otherwise false.

close

public void close()
Close the stream. This is done by flushing the stream and then closing the underlying output stream.
Overrides:
close in class java.io.PrintStream

flush

public void flush()
Flush the stream. This is done by writing any buffered output bytes to the underlying output stream and then flushing that stream.
Overrides:
flush in class java.io.PrintStream

print

public void print(char[] s)
Print an array of characters. The characters are converted into bytes according to the platform's default character encoding.
Overrides:
print in class java.io.PrintStream
Parameters:
s - char[] The array of chars to be printed.

print

public void print(char c)
Print a character. The character is translated into one or more bytes according to the platform's default character encoding.
Overrides:
print in class java.io.PrintStream
Parameters:
c - char The char to be printed

print

public void print(double d)
Print a double-precision floating-point number. The string printed is the same as that returned by the toString method of the Double class when invoked on the given double value.
Overrides:
print in class java.io.PrintStream
Parameters:
d - double The double to be printed

print

public void print(float f)
Print a floating-point number. The string printed is the same as that returned by the toString method of the Float class when invoked on the given float value.
Overrides:
print in class java.io.PrintStream
Parameters:
f - float The float to be printed

print

public void print(int i)
Print an integer. The string printed is the same as that returned by the toString method of the Integer class when invoked on the given int value.
Overrides:
print in class java.io.PrintStream
Parameters:
i - int The int to be printed

print

public void print(long l)
Print a long integer. The string printed is the same as that returned by the toString method of the Long class when invoked on the given long value.
Overrides:
print in class java.io.PrintStream
Parameters:
l - The long to be printed

print

public void print(java.lang.Object obj)
Print an object. The string printed is the same as that returned by the given object's toString method.
Overrides:
print in class java.io.PrintStream
Parameters:
obj - Object The Object to be printed

print

public void print(java.lang.String s)
Print a string. If the argument is null, the string "null" is written to the underlying output stream. Otherwise, the string's characters are converted into bytes according to the platform's default character encoding.
Overrides:
print in class java.io.PrintStream
Parameters:
s - String The String to be printed

print

public void print(boolean b)
Print a boolean value. If the given value is true, then the string "true" is written to the underlying output stream; otherwise, the string "false" is written.
Overrides:
print in class java.io.PrintStream
Parameters:
b - boolean The boolean to be printed

println

public void println()
Finish the current line by writing a line separator. The line separator string is defined by the system property line.separator, and is not necessarily a single newline character ('\n').
Overrides:
println in class java.io.PrintStream

println

public void println(char[] x)
Print an array of characters, and then finish the line.
Overrides:
println in class java.io.PrintStream

println

public void println(char x)
Print a character, and then finish the line.
Overrides:
println in class java.io.PrintStream

println

public void println(double x)
Print a double, and then finish the line.
Overrides:
println in class java.io.PrintStream

println

public void println(float x)
Print a float, and then finish the line.
Overrides:
println in class java.io.PrintStream

println

public void println(int x)
Print an integer, and then finish the line.
Overrides:
println in class java.io.PrintStream

println

public void println(long x)
Print a long, and then finish the line.
Overrides:
println in class java.io.PrintStream

println

public void println(java.lang.Object x)
Print an Object, and then finish the line.
Overrides:
println in class java.io.PrintStream

println

public void println(java.lang.String x)
Print a String, and then finish the line.
Overrides:
println in class java.io.PrintStream

println

public void println(boolean x)
Print a boolean, and then finish the line.
Overrides:
println in class java.io.PrintStream

write

public void write(byte[] buf,
                  int off,
                  int len)
Write a portion of a byte array, blocking if necessary.
Overrides:
write in class java.io.PrintStream
Parameters:
buf - A byte array
off - Offset from which to start taking bytes
len - Number of bytes to write

write

public void write(int b)
Write a byte, blocking if necessary. If the character is a newline and automatic flushing is enabled, the stream's flush method will be called.

Note that the byte is written as given; to write a character that will be translated according to the platform's default character encoding, use the print(char) or println(char) methods.

Overrides:
write in class java.io.PrintStream
Parameters:
b - int The byte to be written

write

public abstract void write(java.lang.String s)
This method writes a String in the PrintStream.