|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jenes.utils.AbstractLogger jenes.utils.CSVLogger
public class CSVLogger
This class defines a StatisticsLogger based on CSV (comma separated values) file. The logger has a schema, made of the fields the user means to record. If the schema is not specified, the logger use the set of keys making a record as schema. The default separator is tab, but a different separator can be specified at instantiation time. The default logfile is named log.csv and placed into the working directory. The logger can record or not the first line with the header made of the field names.
Field Summary |
---|
Fields inherited from class jenes.utils.AbstractLogger |
---|
closed, record, schema |
Constructor Summary | |
---|---|
CSVLogger(java.lang.String[] schema)
Creates a logger with the specified schema, and log.csv as default filename, tab as default separator. |
|
CSVLogger(java.lang.String[] schema,
java.lang.String filename)
Creates a logger with the specified schema and filename, tab as default separator. |
|
CSVLogger(java.lang.String[] schema,
java.lang.String filename,
java.lang.String separator)
Creates a logger with the specified schema, filename and separator. |
|
CSVLogger(java.lang.String[] schema,
java.lang.String filename,
java.lang.String separator,
boolean header)
Creates a logger with the specified schema, filename and separator. |
Method Summary | |
---|---|
protected void |
doClose()
Closes the logger. |
protected void |
doSave()
Saves cached records on media |
java.io.PrintWriter |
getOut()
Return the output stream used for logging. |
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 |
---|
public CSVLogger(java.lang.String[] schema) throws java.io.FileNotFoundException
schema
- - the array making the schema of records
java.io.FileNotFoundException
public CSVLogger(java.lang.String[] schema, java.lang.String filename) throws java.io.FileNotFoundException
schema
- - the array making the schema of recordsfilename
- - the output filename
java.io.FileNotFoundException
public CSVLogger(java.lang.String[] schema, java.lang.String filename, java.lang.String separator) throws java.io.FileNotFoundException
schema
- - the array making the schema of recordsfilename
- - the output filenameseparator
- - the values separator
java.io.FileNotFoundException
public CSVLogger(java.lang.String[] schema, java.lang.String filename, java.lang.String separator, boolean header) throws java.io.FileNotFoundException
schema
- - the array making the schema of recordsfilename
- - the output filenameseparator
- - the values separatorheader
- - the header is included if true, otherwise not.
java.io.FileNotFoundException
Method Detail |
---|
public java.io.PrintWriter getOut()
protected void store()
AbstractLogger
store
in class AbstractLogger
protected void doSave()
AbstractLogger
doSave
in class AbstractLogger
protected void doClose()
AbstractLogger
doClose
in class AbstractLogger
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |