com.sparsity.sparksee.io
Class TypeExporter

java.lang.Object
  extended by com.sparsity.sparksee.io.TypeExporter
Direct Known Subclasses:
EdgeTypeExporter, NodeTypeExporter

public class TypeExporter
extends java.lang.Object

Base TypeExporter class.

Base class to export a node or edge type from a graph using a RowWriter.

TypeExporterListener can be registered to receive information about the progress of the export process by means of TypeExporterEvent. The default frequency of notification to listeners is 100000.

By default no header row is created.

Check out the 'Data export' section in the SPARKSEE User Manual for more details on this.

Author:
Sparsity Technologies http://www.sparsity-technologies.com

Method Summary
 void register(TypeExporterListener tel)
          Registers a new listener.
 void run()
          Runs export process.
 void setAttributes(AttributeList attrs)
          Sets the list of Attributes.
 void setFrequency(int freq)
          Sets the frequency of listener notification.
 void setGraph(Graph graph)
          Sets the graph that will be exported.
 void setHeader(boolean header)
          Sets the presence of a header row.
 void setRowWriter(RowWriter rw)
          Sets the output data destination.
 void setType(int type)
          Sets the type to be exported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setRowWriter

public void setRowWriter(RowWriter rw)
Sets the output data destination.

Parameters:
rw - [in] Input RowWriter.

setFrequency

public void setFrequency(int freq)
Sets the frequency of listener notification.

Parameters:
freq - [in] Frequency in number of rows managed to notify progress to all listeners

run

public void run()
         throws java.io.IOException,
                java.lang.RuntimeException
Runs export process.

Throws:
java.io.IOException - If bad things happen writing to the RowWriter.
java.lang.RuntimeException - null

register

public void register(TypeExporterListener tel)
Registers a new listener.

Parameters:
tel - [in] TypeExporterListener to be registered.

setGraph

public void setGraph(Graph graph)
Sets the graph that will be exported.

Parameters:
graph - [in] Graph.

setHeader

public void setHeader(boolean header)
Sets the presence of a header row.

Parameters:
header - [in] If TRUE, a header row is dumped with the name of the attributes.

setType

public void setType(int type)
Sets the type to be exported.

Parameters:
type - [in] Type identifier.

setAttributes

public void setAttributes(AttributeList attrs)
Sets the list of Attributes.

Parameters:
attrs - [in] Attribute identifiers to be exported