Groovy Documentation

com.xlson.groovycsv
[Groovy] Class CsvIterator

java.lang.Object
  com.xlson.groovycsv.CsvIterator

class CsvIterator

Iterates over the csv data in a non-synchronized way.

Authors:
Leonard Axelsson
Since:
0.1


Constructor Summary
CsvIterator(java.lang.Object columnNames, CSVReader csvReader)

 
Method Summary
void close()

Closes the underlying reader object.

boolean hasNext()

Checks if there is more data available.

boolean isClosed()

Checks if the underlying reader is closed.

java.lang.Object next()

Gets the next row in the csv file.

void remove()

remove is not supported in CsvIterator.

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

CsvIterator

CsvIterator(java.lang.Object columnNames, CSVReader csvReader)


 
Method Detail

close

void close()
Closes the underlying reader object. Could be useful if one would not like to read all of the csv into memory.
throws:
IllegalStateException if the underlying dataset is already closed.


hasNext

boolean hasNext()
Checks if there is more data available. Will close the underlying dataset if there isn't any more data.
Returns:
true if there is more data in the iterator


isClosed

boolean isClosed()
Checks if the underlying reader is closed.
Returns:
true if the underlying reader is closed


next

java.lang.Object next()
Gets the next row in the csv file.
Returns:
an instance of PropertyMapper


remove

void remove()
remove is not supported in CsvIterator.
throws:
UnsupportedOperationException when called


 

Groovy Documentation