public class CsvLogger
extends java.lang.Object
implements java.io.Closeable
Constructor and Description |
---|
CsvLogger(java.lang.String fileName)
Initializes a new instance of the CsvLogger class.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this stream and releases any system resources associated
with it.
|
static java.lang.String |
getDefaultHeader(java.util.List<NegotiationParty> partyList)
Generate default header
|
static java.lang.String |
join(java.util.Collection<?> s,
java.lang.String delimiter)
Helper method.
|
void |
log(java.lang.Object value)
Log a given object.
|
static java.lang.String |
logDefaultSession(Session session,
Protocol protocol,
java.util.List<NegotiationParty> parties,
double runTime)
Log default session information
|
void |
logLine(java.lang.Object... values)
Logs a complete line to the file.
|
static java.lang.String |
logSingleSession(Session session,
Protocol protocol,
java.util.List<NegotiationParty> parties,
double runTime) |
public CsvLogger(java.lang.String fileName) throws java.io.FileNotFoundException
fileName
- The name of the file to log to (including the .csv extension)java.io.FileNotFoundException
- Thrown by the PrintStream if the location is not writable.public static java.lang.String join(java.util.Collection<?> s, java.lang.String delimiter)
s
- Collection of objects to create string ofdelimiter
- The delimiter used between objectpublic void log(java.lang.Object value)
value
- The object to logpublic void logLine(java.lang.Object... values)
values
- zero or more objects to log, using ; delimiterpublic static java.lang.String getDefaultHeader(java.util.List<NegotiationParty> partyList)
partyList
- list of parties to print in the headerpublic static java.lang.String logDefaultSession(Session session, Protocol protocol, java.util.List<NegotiationParty> parties, double runTime) throws java.lang.Exception
java.lang.Exception
public static java.lang.String logSingleSession(Session session, Protocol protocol, java.util.List<NegotiationParty> parties, double runTime) throws java.lang.Exception
java.lang.Exception
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
- if an I/O error occurs