Package org.cip4.jdflib.cformat
Class PrintfWriter
java.lang.Object
java.io.Writer
java.io.PrintWriter
org.cip4.jdflib.cformat.PrintfWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
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:
-
Field Summary
Fields inherited from class java.io.PrintWriter
out -
Constructor Summary
ConstructorsConstructorDescriptionPrintfWriter(OutputStream pout) Deprecated.Creates a PrintfWriter, without automatic line flushing, from an existing OutputStream.PrintfWriter(OutputStream pout, boolean autoFlush) Deprecated.Creates a PrintfWriter from an existing OutputStream.PrintfWriter(Writer pout) Deprecated.Creates a PrintfWriter, without automatic line flushing, from an existing Writer.PrintfWriter(Writer pout, boolean autoFlush) Deprecated.Creates a PrintfWriter from an existing Writer. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.Prints a char in accordance with the supplied format string.voidDeprecated.Prints a double in accordance with the supplied format string.voidDeprecated.Prints a float in accordance with the supplied format string.voidDeprecated.Prints an int in accordance with the supplied format string.voidDeprecated.Prints a long in accordance with the supplied format string.voidDeprecated.Prints a String in accordance with the supplied format string.voidprintf(PrintfFormat fmt, char x) Deprecated.Prints a char in accordance with the supplied PrintfFormat object.voidprintf(PrintfFormat fmt, double x) Deprecated.Prints a double in accordance with the supplied PrintfFormat object.voidprintf(PrintfFormat fmt, float x) Deprecated.Prints a float in accordance with the supplied PrintfFormat object.voidprintf(PrintfFormat fmt, int x) Deprecated.Prints an int in accordance with the supplied PrintfFormat object.voidprintf(PrintfFormat fmt, long x) Deprecated.Prints a long in accordance with the supplied PrintfFormat object.voidprintf(PrintfFormat fmt, 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, writeMethods inherited from class java.io.Writer
nullWriter
-
Constructor Details
-
PrintfWriter
Deprecated.Creates a PrintfWriter, without automatic line flushing, from an existing OutputStream.- Parameters:
out- An output stream
-
PrintfWriter
Deprecated.Creates a PrintfWriter, without automatic line flushing, from an existing Writer.- Parameters:
out- A writer
-
PrintfWriter
Deprecated.Creates a PrintfWriter from an existing OutputStream.- Parameters:
out- An output streamautoFlush- If true, specifies that output flushing will automatically occur when the println() methods are called.
-
PrintfWriter
Deprecated.Creates a PrintfWriter from an existing Writer.- Parameters:
out- A writerautoFlush- If true, specifies that output flushing will automatically occur when the println() methods are called.
-
-
Method Details
-
printf
Deprecated.Prints a double in accordance with the supplied format string.- Parameters:
fs- Format stringx- Double to output- Throws:
IllegalArgumentException- Malformed format string
-
printf
Deprecated.Prints a float in accordance with the supplied format string.- Parameters:
fs- Format stringx- Float to output- Throws:
IllegalArgumentException- Malformed format string
-
printf
Deprecated.Prints a long in accordance with the supplied format string.- Parameters:
fs- Format stringx- Long to output- Throws:
IllegalArgumentException- Malformed format string
-
printf
Deprecated.Prints an int in accordance with the supplied format string.- Parameters:
fs- Format stringx- Int to output- Throws:
IllegalArgumentException- Malformed format string
-
printf
Deprecated.Prints a String in accordance with the supplied format string.- Parameters:
fs- Format stringx- String to output- Throws:
IllegalArgumentException- Malformed format string
-
printf
Deprecated.Prints a char in accordance with the supplied format string.- Parameters:
fs- Format stringx- Char to output- Throws:
IllegalArgumentException- Malformed format string
-
printf
Deprecated.Prints a double in accordance with the supplied PrintfFormat object.- Parameters:
fmt- Formatting objectx- Double to output- See Also:
-
printf
Deprecated.Prints a float in accordance with the supplied PrintfFormat object.- Parameters:
fmt- Formatting objectx- Float to output- See Also:
-
printf
Deprecated.Prints a long in accordance with the supplied PrintfFormat object.- Parameters:
fmt- Formatting objectx- Long to output- See Also:
-
printf
Deprecated.Prints an int in accordance with the supplied PrintfFormat object.- Parameters:
fmt- Formatting objectx- Int to output- See Also:
-
printf
Deprecated.Prints a String in accordance with the supplied PrintfFormat object.- Parameters:
fmt- Formatting objectx- String to output- See Also:
-
printf
Deprecated.Prints a char in accordance with the supplied PrintfFormat object.- Parameters:
fmt- Formatting objectx- Char to output- See Also:
-