Takes a table and produces a text file representing it.
Purpose: Produces a text file, using a given delimiter,
representing the data in a given table.
Used by: OutputToFile
Uses: string
Attributes: None
SRS Refs: 3.2.1.6d
Author: caedwa
Date: 18/7/02
|
Methods
|
|
__init__
closeFile
openFile
writeHeader
writeTable
|
|
|
__init__
|
__init__ (
self,
table,
delimiter=' ',
usestreamid=1,
)
Purpose: Creates a new instance of the TableFile
class, using the
table given as the data source. Optionally,
a delimiter can be specified, otherwise a
space character is used. Also, the format of the
file can be specified, either as using the stream
id as a separate column to distinguish between
streams, or combining the data into one table with
streams each as a column. Used by: OutputToFile
Uses: None
Input: table : Table,
delimiter : string,
usestreamid : int (0 or 1)
Output: New instance of the class TableFile
Preconditions: None
Postconditions: None
SRS Refs: 3.2.1.6d
Author: caedwa
Date: 18/7/02
|
|
|
closeFile
|
closeFile ( self )
Purpose: Closes the file which has been opened
Used by: OutputToFile
Uses: None
Input: None
Output: None
Preconditions: None
Postconditions: The file is opened if it was opened already.
SRS Refs: 3.2.1.6d
Author: caedwa
Date: 18/7/02
|
|
|
openFile
|
openFile ( self, filename )
Purpose: Opens the file of the filename given, ready
for writing.
Used by: OutputToFile Uses: None
Input: filename : string
Output: None
Preconditions: None
Postconditions: None
SRS Refs: 3.2.1.6d
Author: caedwa
Date: 18/7/02
|
|
|
writeHeader
|
writeHeader ( self )
Purpose: Writes a header line to the file. If the variable
__usestreamid is set to 1, a separate column for
the stream id is added, otherwise, each column
represents a stream and the stream id is added to
the label for that column. Used by: writeTable
Uses: string
Input: None
Output: None
Preconditions: File has been opened
Postconditions: None
SRS Refs: 3.2.1.6d
Author: caedwa
Date: 18/7/02
|
|
|
writeTable
|
writeTable ( self )
Purpose: Writes the table to the file. First writes the
header, then, depending on the format selected,
writes the table in the specified format (either
with a separate column called streamid, or as a
single table with columns for each stream). In the
case of a Table with a single array, the stream
ids are not shown since they are unnecessary. Used by: OutputToFile
Uses: string
Input: None
Output: None
Preconditions: None
Postconditions: None
SRS Refs: 3.2.1.6d
Author: caedwa
Date: 18/7/02
|
|