© 2002 BEA Systems, Inc.


com.bea.commerce.ebusiness.discount.util
Class DateWriter

java.lang.Object
  |
  +--java.io.Writer
        |
        +--java.io.PrintWriter
              |
              +--com.bea.commerce.ebusiness.discount.util.DateWriter

public class DateWriter
extends java.io.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.


Field Summary
protected  java.lang.String className
           
static java.lang.String colon
           
static java.lang.String space
           
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
DateWriter(java.io.OutputStream out)
           
DateWriter(java.io.OutputStream out, boolean autoFlush)
           
DateWriter(java.io.OutputStream out, java.text.SimpleDateFormat format)
           
DateWriter(java.io.OutputStream out, java.text.SimpleDateFormat format, boolean autoFlush)
           
DateWriter(java.io.Writer writer)
          Creates DateWriter without autoflushing that uses the default format provided by the default SimpleDateFormat constructor.
DateWriter(java.io.Writer writer, boolean autoFlush)
          Creates DateWriter without autoflushing that uses the default format provided by the default SimpleDateFormat constructor.
DateWriter(java.io.Writer writer, java.text.SimpleDateFormat format)
          Creates DateWriter without autoflushing, using the specified date format.
DateWriter(java.io.Writer writer, java.text.SimpleDateFormat format, boolean autoFlush)
          Creates DateWriter with autoflushing, using the specified date format.
 
Method Summary
 java.lang.String currentTime()
           
 void print(int x)
          Print a string and a timestamp if following a println() call otherwise print the string only.
 void print(java.lang.String s)
          Print a string and a timestamp if following a println() call otherwise print the string only.
 void println()
          print a new line and no timestamp.
 void println(int x)
          print a string prepended with a timestamp and a space, terminate with a newline.
 void println(java.lang.String s)
          print a string prepended with a timestamp and a space, terminate with a newline.
 
Methods inherited from class 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 inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

space

public static final java.lang.String space

colon

public static final java.lang.String colon

className

protected java.lang.String className
Constructor Detail

DateWriter

public DateWriter(java.io.OutputStream out)

DateWriter

public DateWriter(java.io.OutputStream out,
                  boolean autoFlush)

DateWriter

public DateWriter(java.io.OutputStream out,
                  java.text.SimpleDateFormat format)

DateWriter

public DateWriter(java.io.OutputStream out,
                  java.text.SimpleDateFormat format,
                  boolean autoFlush)

DateWriter

public DateWriter(java.io.Writer writer)
Creates DateWriter without autoflushing that uses the default format provided by the default SimpleDateFormat constructor.

See Also:
SimpleDateFormat

DateWriter

public DateWriter(java.io.Writer writer,
                  boolean autoFlush)
Creates DateWriter without autoflushing that uses the default format provided by the default SimpleDateFormat constructor.

See Also:
SimpleDateFormat

DateWriter

public DateWriter(java.io.Writer writer,
                  java.text.SimpleDateFormat format)
Creates DateWriter without autoflushing, using the specified date format.

DateWriter

public DateWriter(java.io.Writer writer,
                  java.text.SimpleDateFormat format,
                  boolean autoFlush)
Creates DateWriter with autoflushing, using the specified date format.
Method Detail

print

public void print(java.lang.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.

Parameters:
s - The String to be printed
Overrides:
print in class java.io.PrintWriter

print

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.

Parameters:
s - The String to be printed
Overrides:
print in class java.io.PrintWriter

println

public void println()
print a new line and no timestamp.

Overrides:
println in class java.io.PrintWriter

println

public void println(java.lang.String s)
print a string prepended with a timestamp and a space, terminate with a newline.

Overrides:
println in class java.io.PrintWriter

println

public void println(int x)
print a string prepended with a timestamp and a space, terminate with a newline.

Overrides:
println in class java.io.PrintWriter

currentTime

public java.lang.String currentTime()

Returns:
String the current time and thread name formatted for logging

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved