uchicago.src.sim.network
Class ASCIIFormatter

java.lang.Object
  extended by uchicago.src.sim.network.ASCIIFormatter
All Implemented Interfaces:
NetworkMatrixFormatter

public class ASCIIFormatter
extends java.lang.Object
implements NetworkMatrixFormatter

Formats AdjacencyMatrices into a comma delimited plain text format. This can be used by a NetworkRecorder to record network in a plain text format. In this format network data looks like:

 matrix label: _label_
             ,node_label_0, node_label_1, ...
 node_label_0, data_00, data_01, ...
 node_label_1, data_10, data_11, ...
 ...
 
If a network has no label names, comma-delimited empty strings will be used. For example, matrix label: mLabel ,,,,, ,0,1,0,0,0 ,0,0,1,0,0 ,0,0,0,1,0 ,0,0,0,0,1 ,0,0,0,0,0 This format intended as a substitute for the excel format given the exceedingly long time it takes to write to an excel file. Data in this format is easily imported into excel such that the actual matrix will begin in cell B:2.

Version:
$Revision: 1.5 $ $Date: 2004/11/03 19:51:01 $
Author:
Nick Collier

Constructor Summary
ASCIIFormatter()
           
 
Method Summary
 void format(java.util.List matrixLabels, java.util.Vector matrices, java.lang.String comment)
          Formats the specified matrices together with the labels, and comment
 java.lang.String getHeader()
          Returns the block header for the matrices formatter in comment.
 java.util.Vector getMatrices()
          Returns a Vector of appropriately Strings representing the matrices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASCIIFormatter

public ASCIIFormatter()
Method Detail

format

public void format(java.util.List matrixLabels,
                   java.util.Vector matrices,
                   java.lang.String comment)
Formats the specified matrices together with the labels, and comment

Specified by:
format in interface NetworkMatrixFormatter
Parameters:
matrixLabels - the labels of the matrices
matrices - a Vector of AdjacencyMatrices
comment - an optional comment

getHeader

public java.lang.String getHeader()
Returns the block header for the matrices formatter in comment.

Specified by:
getHeader in interface NetworkMatrixFormatter

getMatrices

public java.util.Vector getMatrices()
Returns a Vector of appropriately Strings representing the matrices.

Specified by:
getMatrices in interface NetworkMatrixFormatter