com.sparsity.dex.io
Class TypeExporter

java.lang.Object
  extended by com.sparsity.dex.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 DEX 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 g)
          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 t)
          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.

rr[in] Input RowWriter.

Parameters:
rw - null

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.

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.

setFrequency

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

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

Parameters:
freq - null

setAttributes

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

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

setGraph

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

Parameters:
g - [in] Graph.

setType

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

Parameters:
t - [in] Type identifier.