Class PrintfWriter

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

    @Deprecated
    public class PrintfWriter
    extends java.io.PrintWriter
    Deprecated.
    use standard java writers
    Writer class to output primitive types using C printf style formatting. For each primitive type (float, double, char, int, long, String), there is a printf method which takes (as a first argument) either a printf style format string, or a PrintfFormat object. Using the latter can be more efficient because it permits an application to prorate the overhead of parsing a format string.

    Because Java does not permit variable numbers of arguments, each printf methodName accepts only one primitive type, and the formats can correspondingly contain only one conversion sequence.

    See Also:
    PrintfFormat, PrintfStream
    • Field Summary

      • Fields inherited from class java.io.PrintWriter

        out
      • Fields inherited from class java.io.Writer

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      PrintfWriter​(java.io.OutputStream pout)
      Deprecated.
      Creates a PrintfWriter, without automatic line flushing, from an existing OutputStream.
      PrintfWriter​(java.io.OutputStream pout, boolean autoFlush)
      Deprecated.
      Creates a PrintfWriter from an existing OutputStream.
      PrintfWriter​(java.io.Writer pout)
      Deprecated.
      Creates a PrintfWriter, without automatic line flushing, from an existing Writer.
      PrintfWriter​(java.io.Writer pout, boolean autoFlush)
      Deprecated.
      Creates a PrintfWriter from an existing Writer.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void printf​(java.lang.String fs, char x)
      Deprecated.
      Prints a char in accordance with the supplied format string.
      void printf​(java.lang.String fs, double x)
      Deprecated.
      Prints a double in accordance with the supplied format string.
      void printf​(java.lang.String fs, float x)
      Deprecated.
      Prints a float in accordance with the supplied format string.
      void printf​(java.lang.String fs, int x)
      Deprecated.
      Prints an int in accordance with the supplied format string.
      void printf​(java.lang.String fs, long x)
      Deprecated.
      Prints a long in accordance with the supplied format string.
      void printf​(java.lang.String fs, java.lang.String x)
      Deprecated.
      Prints a String in accordance with the supplied format string.
      void printf​(PrintfFormat fmt, char x)
      Deprecated.
      Prints a char in accordance with the supplied PrintfFormat object.
      void printf​(PrintfFormat fmt, double x)
      Deprecated.
      Prints a double in accordance with the supplied PrintfFormat object.
      void printf​(PrintfFormat fmt, float x)
      Deprecated.
      Prints a float in accordance with the supplied PrintfFormat object.
      void printf​(PrintfFormat fmt, int x)
      Deprecated.
      Prints an int in accordance with the supplied PrintfFormat object.
      void printf​(PrintfFormat fmt, long x)
      Deprecated.
      Prints a long in accordance with the supplied PrintfFormat object.
      void printf​(PrintfFormat fmt, java.lang.String x)
      Deprecated.
      Prints a String in accordance with the supplied PrintfFormat object.
      • 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
    • Constructor Detail

      • PrintfWriter

        public PrintfWriter​(java.io.OutputStream pout)
        Deprecated.
        Creates a PrintfWriter, without automatic line flushing, from an existing OutputStream.
        Parameters:
        out - An output stream
      • PrintfWriter

        public PrintfWriter​(java.io.Writer pout)
        Deprecated.
        Creates a PrintfWriter, without automatic line flushing, from an existing Writer.
        Parameters:
        out - A writer
      • PrintfWriter

        public PrintfWriter​(java.io.OutputStream pout,
                            boolean autoFlush)
        Deprecated.
        Creates a PrintfWriter from an existing OutputStream.
        Parameters:
        out - An output stream
        autoFlush - If true, specifies that output flushing will automatically occur when the println() methods are called.
      • PrintfWriter

        public PrintfWriter​(java.io.Writer pout,
                            boolean autoFlush)
        Deprecated.
        Creates a PrintfWriter from an existing Writer.
        Parameters:
        out - A writer
        autoFlush - If true, specifies that output flushing will automatically occur when the println() methods are called.
    • Method Detail

      • printf

        public void printf​(java.lang.String fs,
                           double x)
        Deprecated.
        Prints a double in accordance with the supplied format string.
        Parameters:
        fs - Format string
        x - Double to output
        Throws:
        java.lang.IllegalArgumentException - Malformed format string
      • printf

        public void printf​(java.lang.String fs,
                           float x)
        Deprecated.
        Prints a float in accordance with the supplied format string.
        Parameters:
        fs - Format string
        x - Float to output
        Throws:
        java.lang.IllegalArgumentException - Malformed format string
      • printf

        public void printf​(java.lang.String fs,
                           long x)
        Deprecated.
        Prints a long in accordance with the supplied format string.
        Parameters:
        fs - Format string
        x - Long to output
        Throws:
        java.lang.IllegalArgumentException - Malformed format string
      • printf

        public void printf​(java.lang.String fs,
                           int x)
        Deprecated.
        Prints an int in accordance with the supplied format string.
        Parameters:
        fs - Format string
        x - Int to output
        Throws:
        java.lang.IllegalArgumentException - Malformed format string
      • printf

        public void printf​(java.lang.String fs,
                           java.lang.String x)
        Deprecated.
        Prints a String in accordance with the supplied format string.
        Parameters:
        fs - Format string
        x - String to output
        Throws:
        java.lang.IllegalArgumentException - Malformed format string
      • printf

        public void printf​(java.lang.String fs,
                           char x)
        Deprecated.
        Prints a char in accordance with the supplied format string.
        Parameters:
        fs - Format string
        x - Char to output
        Throws:
        java.lang.IllegalArgumentException - Malformed format string
      • printf

        public void printf​(PrintfFormat fmt,
                           double x)
        Deprecated.
        Prints a double in accordance with the supplied PrintfFormat object.
        Parameters:
        fmt - Formatting object
        x - Double to output
        See Also:
        PrintfFormat
      • printf

        public void printf​(PrintfFormat fmt,
                           float x)
        Deprecated.
        Prints a float in accordance with the supplied PrintfFormat object.
        Parameters:
        fmt - Formatting object
        x - Float to output
        See Also:
        PrintfFormat
      • printf

        public void printf​(PrintfFormat fmt,
                           long x)
        Deprecated.
        Prints a long in accordance with the supplied PrintfFormat object.
        Parameters:
        fmt - Formatting object
        x - Long to output
        See Also:
        PrintfFormat
      • printf

        public void printf​(PrintfFormat fmt,
                           int x)
        Deprecated.
        Prints an int in accordance with the supplied PrintfFormat object.
        Parameters:
        fmt - Formatting object
        x - Int to output
        See Also:
        PrintfFormat
      • printf

        public void printf​(PrintfFormat fmt,
                           java.lang.String x)
        Deprecated.
        Prints a String in accordance with the supplied PrintfFormat object.
        Parameters:
        fmt - Formatting object
        x - String to output
        See Also:
        PrintfFormat
      • printf

        public void printf​(PrintfFormat fmt,
                           char x)
        Deprecated.
        Prints a char in accordance with the supplied PrintfFormat object.
        Parameters:
        fmt - Formatting object
        x - Char to output
        See Also:
        PrintfFormat