org.apache.mahout.utils.vectors.io
Interface VectorWriter

All Known Implementing Classes:
JWriterVectorWriter, SequenceFileVectorWriter

public interface VectorWriter


Method Summary
 void close()
          Close any internally held resources.
 long write(java.lang.Iterable<Vector> iterable)
          Write all values in the Iterable to the output
 long write(java.lang.Iterable<Vector> iterable, long maxDocs)
          Write the first maxDocs to the output.
 

Method Detail

write

long write(java.lang.Iterable<Vector> iterable)
           throws java.io.IOException
Write all values in the Iterable to the output

Returns:
the number of docs written
Throws:
java.io.IOException - if there was a problem writing

write

long write(java.lang.Iterable<Vector> iterable,
           long maxDocs)
           throws java.io.IOException
Write the first maxDocs to the output.

Parameters:
maxDocs - the maximum number of docs to write
Returns:
The number of docs written
Throws:
java.io.IOException - if there was a problem writing

close

void close()
           throws java.io.IOException
Close any internally held resources. If external Writers are passed in, the implementation should indicate whether it also closes them

Throws:
java.io.IOException - if there was an issue closing the item


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.