uchicago.src.sim.analysis
Class SimData

java.lang.Object
  extended by uchicago.src.sim.analysis.SimData

public class SimData
extends java.lang.Object

Holds data in tabular format - a vector of vectors. Also provides methods for printing the data to a file.

Version:
$Revision: 1.7 $ $Date: 2004/11/03 19:51:00 $
Author:
Nick Collier
See Also:
DataRecorder

Nested Class Summary
 class SimData.SimDataIterator
           
 
Constructor Summary
SimData(java.lang.String modelHeader, SimModel model, boolean isBatch)
          Constructs a new SimData object from the model header, model and batch flag
SimData(java.lang.String fileName, java.lang.String modelHeader, SimModel model, boolean isBatch)
          Deprecated.  
 
Method Summary
 void addData(java.util.List v)
          Add a vector of data to this SimData.
 void addToHeader(java.util.List l)
          Adds the specified list to the header associated with this data
 void addToHeader(java.lang.String s)
          Adds the specified String to the header associated with this data
 java.lang.String getData()
          Get the data stored in this SimData object and clear this object.
 java.lang.String getHeader()
           
 java.lang.String getModelHeader()
           
 java.util.Iterator iterator()
           
 void setDelimiter(java.lang.String delim)
          Sets the column delimiter.
 void writeEnd()
          Deprecated.  
 boolean writeHeader()
           
 void writeToFile()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimData

public SimData(java.lang.String fileName,
               java.lang.String modelHeader,
               SimModel model,
               boolean isBatch)
Deprecated. 

Constructs this object with the specified fileName, model, and mode.

Parameters:
fileName - the fileName to write to
model - the model from which the data is taken. Used to create the file header.
isBatch - whether the simulation is run in batch mode or not

SimData

public SimData(java.lang.String modelHeader,
               SimModel model,
               boolean isBatch)
Constructs a new SimData object from the model header, model and batch flag

Parameters:
modelHeader -
model - the model from which the data is taken. Used to create the file header.
isBatch - whether the simulation is run in batch mode or not
Method Detail

getHeader

public java.lang.String getHeader()

writeHeader

public boolean writeHeader()

getModelHeader

public java.lang.String getModelHeader()

setDelimiter

public void setDelimiter(java.lang.String delim)
Sets the column delimiter. Data is written out in tabular format where the columns are separated by the specified delimiter.

Parameters:
delim - the new delimiter

addToHeader

public void addToHeader(java.lang.String s)
Adds the specified String to the header associated with this data


addToHeader

public void addToHeader(java.util.List l)
Adds the specified list to the header associated with this data


addData

public void addData(java.util.List v)
Add a vector of data to this SimData.

Parameters:
v - the data to add.

writeEnd

public void writeEnd()
Deprecated. 

Writes ending data (current time) to the file Please use getData and the DataRecorder methods instead


writeToFile

public void writeToFile()
Deprecated. 

Writes the data (and a file header) out to a file. This flushes all data from the data vector out to a file. Please use getData() instead


getData

public java.lang.String getData()
Get the data stored in this SimData object and clear this object. This is the preferred way of recording data. Get the data as a String and return it to the recorder object.

Returns:
The data currently in the SimData object.

iterator

public java.util.Iterator iterator()