SparkseePython  6.0.2
Public Member Functions | List of all members
sparksee.RowReader Class Reference

RowReader interface. More...

Inheritance diagram for sparksee.RowReader:
Inheritance graph

Public Member Functions

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

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

def sparksee.RowReader.close (   self)

Closes the reader.

Exceptions
IOErrorIf the close fails.
def 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.
def 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.
def 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.