public abstract class Logger
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
flushCounter
The flush counter ensures regular flushing of the writer.
|
static Logger |
NO_LOGGER
Holder for simulation without a logger.
|
protected Simulator |
simulator
The simulator.
|
private java.io.PrintWriter |
writer
The
PrintWriter . |
Constructor and Description |
---|
Logger()
Empty constructor to allow for joint loggers.
|
Logger(java.lang.String fileName)
Creates a logger.
|
Modifier and Type | Method and Description |
---|---|
void |
closeLog()
Close the log.
|
void |
printLine(java.lang.String string)
Print a line.
|
void |
setSimulator(Simulator simulator)
Sets the simulator.
|
abstract void |
update(long time,
boolean ended)
Updates the log.
|
public static final Logger NO_LOGGER
private java.io.PrintWriter writer
PrintWriter
.private int flushCounter
protected Simulator simulator
public Logger()
public Logger(java.lang.String fileName)
fileName
- The file name.public void closeLog()
public void printLine(java.lang.String string)
string
- The string.public void setSimulator(Simulator simulator)
simulator
- The simulator.public abstract void update(long time, boolean ended)
time
- The time.ended
- If the simulation has ended or not.