org.apache.mahout.utils.vectors.io
Class JWriterVectorWriter

java.lang.Object
  extended by org.apache.mahout.utils.vectors.io.JWriterVectorWriter
All Implemented Interfaces:
VectorWriter

public class JWriterVectorWriter
extends java.lang.Object
implements VectorWriter


Constructor Summary
JWriterVectorWriter(java.io.Writer writer)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JWriterVectorWriter

public JWriterVectorWriter(java.io.Writer writer)
Method Detail

write

public long write(java.lang.Iterable<Vector> iterable)
           throws java.io.IOException
Description copied from interface: VectorWriter
Write all values in the Iterable to the output

Specified by:
write in interface VectorWriter
Returns:
the number of docs written
Throws:
java.io.IOException - if there was a problem writing

write

public long write(java.lang.Iterable<Vector> iterable,
                  long maxDocs)
           throws java.io.IOException
Description copied from interface: VectorWriter
Write the first maxDocs to the output.

Specified by:
write in interface VectorWriter
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

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

Specified by:
close in interface VectorWriter
Throws:
java.io.IOException - if there was an issue closing the item


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