DateWriter Class
- public class DateWriter
extends PrintWriter
This class prepends printed strings with a timestamp.
NOT FULLY IMPLEMENTED!!! Currently only the println( String ),
println( int) and println() methods have been implemented.
-
Hierarchy
-
Object
Writer
PrintWriter
DateWriter
-
DateWriter(
OutputStream out, boolean autoFlush)
|
-
DateWriter(
OutputStream out, SimpleDateFormat format, boolean autoFlush)
|
-
DateWriter(
OutputStream out, SimpleDateFormat format)
|
-
DateWriter(
OutputStream out)
|
-
DateWriter(
Writer writer, boolean autoFlush)
- Creates DateWriter without autoflushing that uses the default format
provided by the default SimpleDateFormat constructor.
|
-
DateWriter(
Writer writer, SimpleDateFormat format, boolean autoFlush)
- Creates DateWriter with autoflushing, using the specified date format.
|
-
DateWriter(
Writer writer, SimpleDateFormat format)
- Creates DateWriter without autoflushing, using the specified date format.
|
-
DateWriter(
Writer writer)
- Creates DateWriter without autoflushing that uses the default format
provided by the default SimpleDateFormat constructor.
|
public String |
-
currentTime ()
|
public void |
-
print (String s)
- Print a string and a timestamp if following a println() call otherwise
print the string only.
|
public void |
-
print (int x)
- Print a string and a timestamp if following a println() call otherwise
print the string only.
|
public void |
-
println ()
- print a new line and no timestamp.
|
public void |
-
println (String s)
- print a string prepended with a timestamp and a space, terminate with a
newline.
|
public void |
-
println (int x)
- print a string prepended with a timestamp and a space, terminate with a
newline.
|
Methods from java.io.PrintWriter |
checkError, close, flush, print, print, print, print, print, print, print, println, println, println, println, println, println, println, setError, write, write, write, write, write |
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
className
protected String
className
colon
public static final String
colon
space
public static final String
space
DateWriter
public DateWriter(OutputStream
out,
boolean autoFlush)
DateWriter
public DateWriter(OutputStream
out,
SimpleDateFormat
format,
boolean autoFlush)
DateWriter
public DateWriter(OutputStream
out,
SimpleDateFormat
format)
DateWriter
public DateWriter(OutputStream
out)
DateWriter
public DateWriter(Writer
writer,
boolean autoFlush)
- Creates DateWriter without autoflushing that uses the default format
provided by the default SimpleDateFormat constructor.
Related Topics
SimpleDateFormat
DateWriter
public DateWriter(Writer
writer,
SimpleDateFormat
format,
boolean autoFlush)
- Creates DateWriter with autoflushing, using the specified date format.
DateWriter
public DateWriter(Writer
writer,
SimpleDateFormat
format)
- Creates DateWriter without autoflushing, using the specified date format.
DateWriter
public DateWriter(Writer
writer)
- Creates DateWriter without autoflushing that uses the default format
provided by the default SimpleDateFormat constructor.
Related Topics
SimpleDateFormat
currentTime() Method
public String
currentTime()
Returns
- String the current time and thread name formatted for logging
print(String) Method
public void print(String
s)
Print a string and a timestamp if following a println() call otherwise
print the string only. Other than the inclusion of a timestamp this
method is identical to calling print( String ) of PrintWriter.
-
Overrides
-
PrintWriter.print(String)
Parameters
-
s
- The
String
to be printed
print(int) Method
public void print(int x)
Print a string and a timestamp if following a println() call otherwise
print the string only. Other than the inclusion of a timestamp this
method is identical to calling print( String ) of PrintWriter.
-
Overrides
-
PrintWriter.print(int)
Parameters
-
x
- The
String
to be printed
println() Method
public void println()
print a new line and no timestamp.
-
Overrides
-
PrintWriter.println()
println(String) Method
public void println(String
s)
print a string prepended with a timestamp and a space, terminate with a
newline.
-
Overrides
-
PrintWriter.println(String)
println(int) Method
public void println(int x)
print a string prepended with a timestamp and a space, terminate with a
newline.
-
Overrides
-
PrintWriter.println(int)