org.apache.mahout.utils.vectors.csv
Class CSVVectorIterator

java.lang.Object
  extended by com.google.common.collect.UnmodifiableIterator<T>
      extended by com.google.common.collect.AbstractIterator<Vector>
          extended by org.apache.mahout.utils.vectors.csv.CSVVectorIterator
All Implemented Interfaces:
Iterator<Vector>

public class CSVVectorIterator
extends com.google.common.collect.AbstractIterator<Vector>

Iterates a CSV file and produces Vector.
The Iterator returned throws UnsupportedOperationException for the Iterator.remove() method.

Assumes DenseVector for now, but in the future may have the option of mapping columns to sparse format

The Iterator is not thread-safe.


Constructor Summary
CSVVectorIterator(Reader reader)
           
CSVVectorIterator(Reader reader, org.apache.commons.csv.CSVStrategy strategy)
           
 
Method Summary
protected  Vector computeNext()
           
 
Methods inherited from class com.google.common.collect.AbstractIterator
endOfData, hasNext, next, peek
 
Methods inherited from class com.google.common.collect.UnmodifiableIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVVectorIterator

public CSVVectorIterator(Reader reader)

CSVVectorIterator

public CSVVectorIterator(Reader reader,
                         org.apache.commons.csv.CSVStrategy strategy)
Method Detail

computeNext

protected Vector computeNext()
Specified by:
computeNext in class com.google.common.collect.AbstractIterator<Vector>


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.