jenes.utils
Class XLSLogger

java.lang.Object
  extended by jenes.utils.AbstractLogger
      extended by jenes.utils.XLSLogger

public class XLSLogger
extends AbstractLogger

This class implements a logger based on Excel's XLS files. Data are stored in the first column having the data label as header. It does not matter in which sheet. Recording can start from any row. From which row to start recording can be decided at istantiation or execution time. The class can work with an empty file or with a template provided at instantiation time. Using a template is a helpful with macros and plots, in order to make ready-to-use reports. Requires the libray JExcelApi.

Since:
1.3
Version:
1.3
Author:
Luigi Troiano

Field Summary
 
Fields inherited from class jenes.utils.AbstractLogger
closed, record, schema
 
Constructor Summary
XLSLogger(java.lang.String[] schema)
          Istantiates a new logger with a given schema.
XLSLogger(java.lang.String[] schema, java.lang.String filename)
          Istantiates a new logger with a given schema.
XLSLogger(java.lang.String[] schema, java.lang.String filename, int from)
          Istantiates a new logger with a given schema.
XLSLogger(java.lang.String[] schema, java.lang.String filename, java.lang.String template)
          Istantiates a new logger with a given schema.
 
Method Summary
protected  void doClose()
          Closes the logger.
protected  void doSave()
          Saves cached records on media
 int getLine()
          Provides the current recording row
 jxl.write.WritableWorkbook getWorkbook()
          Rovides the workbook used for writing the statistics.
 void setLine(int line)
          Sets the current recording row at a specified value.
protected  void store()
          Stores the current record.
 
Methods inherited from class jenes.utils.AbstractLogger
close, finalize, get, getFields, getSchema, isRecordComplete, log, put, save
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XLSLogger

public XLSLogger(java.lang.String[] schema)
          throws java.io.IOException
Istantiates a new logger with a given schema. Data are saved by defualt in the workbook jenes.log.xls. Recording starts from row 1.

Parameters:
schema - - the field labels
Throws:
java.io.IOException

XLSLogger

public XLSLogger(java.lang.String[] schema,
                 java.lang.String filename)
          throws java.io.IOException
Istantiates a new logger with a given schema. Recording starts from row 1.

Parameters:
schema - - the field labels
filename - - the workbook filename
Throws:
java.io.IOException

XLSLogger

public XLSLogger(java.lang.String[] schema,
                 java.lang.String filename,
                 int from)
          throws java.io.IOException
Istantiates a new logger with a given schema.

Parameters:
schema - - the field labels
filename - - the workbook filename
from - - the recording initial row
Throws:
java.io.IOException

XLSLogger

public XLSLogger(java.lang.String[] schema,
                 java.lang.String filename,
                 java.lang.String template)
          throws java.io.IOException
Istantiates a new logger with a given schema. Recording starts from row 1.

Parameters:
schema - - the field labels
filename - - the workbook name
template - - the workbook template
Throws:
java.io.IOException
Method Detail

getLine

public int getLine()
Provides the current recording row

Returns:
- recording row

setLine

public void setLine(int line)
Sets the current recording row at a specified value.

Parameters:
line - - the new recording row

getWorkbook

public jxl.write.WritableWorkbook getWorkbook()
Rovides the workbook used for writing the statistics. See JExcelApi documentation for futher information.

Returns:
the workbook

store

protected void store()
Description copied from class: AbstractLogger
Stores the current record.

Specified by:
store in class AbstractLogger

doSave

protected void doSave()
Description copied from class: AbstractLogger
Saves cached records on media

Specified by:
doSave in class AbstractLogger

doClose

protected void doClose()
Description copied from class: AbstractLogger
Closes the logger. Any further log is not allowed.

Specified by:
doClose in class AbstractLogger