Package pal.io

Class OutputTarget

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

    public class OutputTarget
    extends java.io.PrintWriter
    convenience class to create output streams linked to files, stdout, and strings
    Version:
    $Id: OutputTarget.java,v 1.3 2001/07/13 14:39:13 korbinian Exp $
    Author:
    Korbinian Strimmer
    • Field Summary

      • Fields inherited from class java.io.PrintWriter

        out
      • Fields inherited from class java.io.Writer

        lock
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getString()
      get string corresponding to current stream created by openString()
      static OutputTarget openFile​(java.lang.String name)
      open file for writing
      static OutputTarget openStdOut()
      open standard out
      static OutputTarget openString()
      "open" string to write into
      • Methods inherited from class java.io.PrintWriter

        append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
      • Methods inherited from class java.io.Writer

        nullWriter
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • openFile

        public static OutputTarget openFile​(java.lang.String name)
                                     throws java.io.IOException
        open file for writing
        Parameters:
        name - file name
        Returns:
        output stream
        Throws:
        java.io.IOException
      • openStdOut

        public static OutputTarget openStdOut()
        open standard out
        Returns:
        output stream
      • openString

        public static OutputTarget openString()
        "open" string to write into
        Returns:
        output stream
      • getString

        public java.lang.String getString()
        get string corresponding to current stream created by openString()
        Returns:
        string