soc.util
Class DebugRecorder

java.lang.Object
  extended by soc.util.DebugRecorder

public class DebugRecorder
extends java.lang.Object

This class is used to record debugging information that can be accessed during run-time through a client. The debugging information is in the form of a vector of strings. Each debugging vector is stored in a table under a key that is supplied by the user.


Field Summary
private  java.lang.Object currentKey
           
private  java.util.Vector<java.lang.String> currentRecord
           
static int NOT_RECORDING
           
private  boolean on
           
static int RECORDING
           
private  java.util.Map<java.lang.Object,java.util.Vector<java.lang.String>> records
           
private  int state
           
 
Constructor Summary
DebugRecorder()
          constructor
 
Method Summary
 void eraseAllRecords()
          Clear the record table
 java.util.Vector<java.lang.String> getRecord(java.lang.Object key)
          Get a record from the table
 boolean isOn()
           
 void putRecord(java.lang.Object key, java.util.Vector<java.lang.String> rec)
          Store a record in the table
 void record(java.lang.String s)
          Add a string to the current record
 void resume()
          resume recording
 void startRecording(java.lang.Object key)
          Start recording the current plan information
 void stopRecording()
          stop recording and store the vector in the table
 void suspend()
          suspend recording
 void turnOff()
          turn the recorder off
 void turnOn()
          turn the recorder on
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_RECORDING

public static final int NOT_RECORDING
See Also:
Constant Field Values

RECORDING

public static final int RECORDING
See Also:
Constant Field Values

records

private java.util.Map<java.lang.Object,java.util.Vector<java.lang.String>> records

currentKey

private java.lang.Object currentKey

currentRecord

private java.util.Vector<java.lang.String> currentRecord

state

private int state

on

private boolean on
Constructor Detail

DebugRecorder

public DebugRecorder()
constructor

Method Detail

turnOn

public void turnOn()
turn the recorder on


turnOff

public void turnOff()
turn the recorder off


isOn

public boolean isOn()
Returns:
true if the recorder is on

startRecording

public void startRecording(java.lang.Object key)
Start recording the current plan information

Parameters:
key - the key to use to index this recording

stopRecording

public void stopRecording()
stop recording and store the vector in the table


suspend

public void suspend()
suspend recording


resume

public void resume()
resume recording


record

public void record(java.lang.String s)
Add a string to the current record

Parameters:
s - the string to add

getRecord

public java.util.Vector<java.lang.String> getRecord(java.lang.Object key)
Get a record from the table

Parameters:
key - the key for the record
Returns:
the record

putRecord

public void putRecord(java.lang.Object key,
                      java.util.Vector<java.lang.String> rec)
Store a record in the table

Parameters:
key - the key for the record
rec - the record (a vector of strings)

eraseAllRecords

public void eraseAllRecords()
Clear the record table