uk.org.simonsite.log4j.helpers
Class SynchronizedCountingQuietWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.FilterWriter
          extended by org.apache.log4j.helpers.QuietWriter
              extended by uk.org.simonsite.log4j.helpers.SynchronizedCountingQuietWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public final class SynchronizedCountingQuietWriter
extends QuietWriter

Counts the number of characters written. Access to the count is synchronized using the Writer's lock. This is necessary because the count is maintained as a long.

Version:
1.7
Author:
Simon Park
See Also:
CountingQuietWriter

Field Summary
 
Fields inherited from class org.apache.log4j.helpers.QuietWriter
errorHandler
 
Fields inherited from class java.io.FilterWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
SynchronizedCountingQuietWriter(Writer writer, ErrorHandler eh)
           
 
Method Summary
 void close()
           
 void flush()
           
 long getCount()
           
 void setCount(long count)
           
 void write(String string)
           
 
Methods inherited from class org.apache.log4j.helpers.QuietWriter
setErrorHandler
 
Methods inherited from class java.io.FilterWriter
write, write, write
 
Methods inherited from class java.io.Writer
append, append, append, append, append, append, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchronizedCountingQuietWriter

public SynchronizedCountingQuietWriter(Writer writer,
                                       ErrorHandler eh)
Method Detail

write

public final void write(String string)
Overrides:
write in class QuietWriter

flush

public final void flush()
Specified by:
flush in interface Flushable
Overrides:
flush in class QuietWriter

close

public final void close()
                 throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class FilterWriter
Throws:
IOException

getCount

public final long getCount()

setCount

public final void setCount(long count)