SparkseePython3 6.1.0
sparksee.RowReader Class Reference

RowReader interface. More...

Inheritance diagram for sparksee.RowReader:
Inheritance graph

Public Member Functions

 close (self)
 Closes the reader.
 reset (self)
 Moves the reader to the beginning.
 read (self, row)
 Reads the next row as a string array.
 get_row (self)
 The row number for the current row.

Detailed Description

RowReader interface.

Common interface for those readers which get the data as an string array.

It works as follows: perform as many read operations as necessary and call close once at the end. Once close is called no more read operations can be executed.

Check out the 'Data import' section in the SPARKSEE User Manual for more details on this.

Author
Sparsity Technologies http://www.sparsity-technologies.com

Member Function Documentation

◆ close()

sparksee.RowReader.close ( self)

Closes the reader.

Exceptions
IOErrorIf the close fails.

Reimplemented in sparksee.CSVReader.

◆ get_row()

sparksee.RowReader.get_row ( self)

The row number for the current row.

Returns
The current row number; 0 if there is no current row.
Exceptions
IOErrorIf it fails.

Reimplemented in sparksee.CSVReader.

◆ read()

sparksee.RowReader.read ( self,
row )

Reads the next row as a string array.

Parameters
row[out] A string list with each comma-separated element as a separate entry.
Returns
Returns true if a row had been read or false otherwise.
Exceptions
IOErrorIf bad things happen during the read.

Reimplemented in sparksee.CSVReader.

◆ reset()

sparksee.RowReader.reset ( self)

Moves the reader to the beginning.

Restarts the reader.

Returns
true if the reader can be restarted, false otherwise.
Exceptions
IOErrorIf bad things happen during the restart.

Reimplemented in sparksee.CSVReader.