SimObs
Class Trace

java.lang.Object
  |
  +--SimObs.Trace

public class Trace
extends java.lang.Object

Class to allow a running simulation program to write run-time debugging information to a specified output device.


Field Summary
static java.io.PrintWriter traceFile
          Defines the output device
 
Constructor Summary
Trace(java.lang.String fileName)
          Constructor that links the output to the device, naming a file.
 
Method Summary
 void closeTraceFile()
          Safely closes the tracefile if it has ever been used during this simulation run.
 boolean getTrace()
          Returns boolean state of trace data field
 boolean getTraceEverOn()
          Returns boolean state of traceEverOn.
 void print(java.lang.String[] args)
          Writes next to tracefile if trace is true
 void println(java.lang.String[] args)
          Writes a line of text to tracefile if trace is true
 void setTrace(boolean thisState)
          Sets trace to true to allow writing to tracefile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

traceFile

public static java.io.PrintWriter traceFile
Defines the output device
Constructor Detail

Trace

public Trace(java.lang.String fileName)
Constructor that links the output to the device, naming a file.
Method Detail

setTrace

public void setTrace(boolean thisState)
Sets trace to true to allow writing to tracefile

getTrace

public boolean getTrace()
Returns boolean state of trace data field

getTraceEverOn

public boolean getTraceEverOn()
Returns boolean state of traceEverOn. Indicates whether the tracefile has been used during this simulation run.

closeTraceFile

public void closeTraceFile()
Safely closes the tracefile if it has ever been used during this simulation run.

println

public void println(java.lang.String[] args)
Writes a line of text to tracefile if trace is true

print

public void print(java.lang.String[] args)
Writes next to tracefile if trace is true