org.wymiwyg.commons.timelogger
Class TimeLogger

java.lang.Object
  extended by org.wymiwyg.commons.timelogger.TimeLogger
Direct Known Subclasses:
SectionTimeLogger

public class TimeLogger
extends Object

A time-logger logs the time elapsed between invocations of startSection and endSection.


Constructor Summary
TimeLogger()
           
 
Method Summary
 void endSection()
           
static TimeLogger getCurrentSectionTimeLogger()
          Returns the timeLogger returned by the last invocation of startSection for a section that hasn't yet ended Note: there is no special handling of the case when multiple independent timeloggers are used.
 ReportWriter getReportWriter()
           
 List<Section> getSections()
           
 void setReportWriter(ReportWriter reportWriter)
           
 TimeLogger startSection(String description)
           
 void writeReport(Writer writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeLogger

public TimeLogger()
Method Detail

startSection

public TimeLogger startSection(String description)

endSection

public void endSection()

writeReport

public void writeReport(Writer writer)
                 throws IOException
Throws:
IOException

getCurrentSectionTimeLogger

public static TimeLogger getCurrentSectionTimeLogger()
Returns the timeLogger returned by the last invocation of startSection for a section that hasn't yet ended Note: there is no special handling of the case when multiple independent timeloggers are used.

Returns:
the TimeLogger returned by the last invocation of startSection or null if the section ended or startSection was not invoked by the current thread.

getSections

public List<Section> getSections()
Returns:
the sections

getReportWriter

public ReportWriter getReportWriter()
Returns:
the reportWriter

setReportWriter

public void setReportWriter(ReportWriter reportWriter)
Parameters:
reportWriter - the reportWriter to set


Copyright © 2011. All Rights Reserved.