com.github.croesch.micro_debug.commons
Class Printer

java.lang.Object
  extended by com.github.croesch.micro_debug.commons.Printer

public final class Printer
extends Object

The interface to print information to the console.

Since:
Date: Dec 2, 2011
Author:
croesch

Method Summary
static void print(Object obj)
          Writes the text representation of the given object to the PrintStream.
static void printErrorln(Object obj)
          Writes the text representation of the given object as an error to the PrintStream and adds a LF.
static void println(Object obj)
          Writes the text representation of the given object to the PrintStream and adds a LF.
static void println(String line)
          Writes the given text to the PrintStream and adds a LF.
static void printReader(Reader r)
          Prints every line of the given Reader to the PrintStream.
static void setPrintStream(PrintStream newOut)
          Sets the new PrintStream for the printer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

println

public static void println(String line)
Writes the given text to the PrintStream and adds a LF.

Parameters:
line - the text to be printed to the PrintStream. null -values will be ignored.
Since:
Date: Dec 2, 2011

println

public static void println(Object obj)
Writes the text representation of the given object to the PrintStream and adds a LF.

Parameters:
obj - the object, whose text representation should be printed to the PrintStream. null -values will be ignored.
Since:
Date: Dec 2, 2011

print

public static void print(Object obj)
Writes the text representation of the given object to the PrintStream.

Parameters:
obj - the object, whose text representation should be printed to the PrintStream. null -values will be ignored.
Since:
Date: Feb 5, 2011

printErrorln

public static void printErrorln(Object obj)
Writes the text representation of the given object as an error to the PrintStream and adds a LF. If the text representation of the object contains LFs, this will produce several different lines as output.

Parameters:
obj - the object, whose text representation should be printed to the PrintStream as an error.
Since:
Date: Dec 2, 2011

setPrintStream

public static void setPrintStream(PrintStream newOut)
Sets the new PrintStream for the printer. From now on, output will be printed to the given stream.

Parameters:
newOut - the new PrintStream to set, null-values will be ignored.
Since:
Date: Dec 2, 2011

printReader

public static void printReader(Reader r)
Prints every line of the given Reader to the PrintStream.

Parameters:
r - the Reader to read the lines from and print to the PrintStream, null-values will be ignored.
Since:
Date: Dec 3, 2011


Copyright © 2012. All Rights Reserved.