com.sparsity.dex.io
Class EdgeTypeExporter

java.lang.Object
  extended by com.sparsity.dex.io.TypeExporter
      extended by com.sparsity.dex.io.EdgeTypeExporter

public class EdgeTypeExporter
extends TypeExporter

EdgeTypeExporter class.

Specific TypeExporter implementation for edge types.

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

Constructor Summary
EdgeTypeExporter()
          Creates a new instance.
EdgeTypeExporter(RowWriter rw, Graph g, int t, AttributeList attrs, int hPos, int tPos, int hAttr, int tAttr)
          Creates a new instance.
 
Method Summary
 void register(TypeExporterListener tel)
          Registers a new listener.
 void run()
          See TypeExporter::Run.
 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 setHeadAttribute(int attr)
          Sets the attribute that will be used to get the value to be dumped for the head of the edge.
 void setHeader(boolean header)
          Sets the presence of a header row.
 void setHeadPosition(int pos)
          Sets the position (index column) of the head attribute in the exported data.
 void setRowWriter(RowWriter rw)
          Sets the output data destination.
 void setTailAttribute(int attr)
          Sets the attribute that will be used to get the value to be dumped for the tail of the edge.
 void setTailPosition(int pos)
          Sets the position (index column) of the tail attribute in the exported data.
 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
 

Constructor Detail

EdgeTypeExporter

public EdgeTypeExporter(RowWriter rw,
                        Graph g,
                        int t,
                        AttributeList attrs,
                        int hPos,
                        int tPos,
                        int hAttr,
                        int tAttr)
Creates a new instance.

Parameters:
rw - [in] Output RowWriter.
g - [in] Graph.
t - [in] Type identifier.
attrs - [in] Attribute identifiers to be exported.
hPos - [in] The position (index column) for the head value.
tPos - [in] The position (index column) for the tail value.
hAttr - [in] The attribute identifier to get the value to be dumped for the head.
tAttr - [in] The attribute identifier to get the value to be dumped for the tail.

EdgeTypeExporter

public EdgeTypeExporter()
Creates a new instance.

Method Detail

setTailPosition

public void setTailPosition(int pos)
Sets the position (index column) of the tail attribute in the exported data.

Parameters:
pos - [in] Tail position

setAttributes

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

Overrides:
setAttributes in class TypeExporter
Parameters:
attrs - [in] Attribute identifiers to be exported

setHeadAttribute

public void setHeadAttribute(int attr)
Sets the attribute that will be used to get the value to be dumped for the head of the edge.

Parameters:
attr - [in] Head Attribute

setRowWriter

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

rr[in] Input RowWriter.

Overrides:
setRowWriter in class TypeExporter
Parameters:
rw - null

register

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

Overrides:
register in class TypeExporter
Parameters:
tel - [in] TypeExporterListener to be registered.

run

public void run()
         throws java.io.IOException,
                java.lang.RuntimeException
See TypeExporter::Run.

Overrides:
run in class TypeExporter
Throws:
java.io.IOException - null
java.lang.RuntimeException - null

setHeader

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

Overrides:
setHeader in class TypeExporter
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

Overrides:
setFrequency in class TypeExporter
Parameters:
freq - null

setGraph

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

Overrides:
setGraph in class TypeExporter
Parameters:
g - [in] Graph.

setTailAttribute

public void setTailAttribute(int attr)
Sets the attribute that will be used to get the value to be dumped for the tail of the edge.

Parameters:
attr - [in] Tail Attribute

setType

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

Overrides:
setType in class TypeExporter
Parameters:
t - [in] Type identifier.

setHeadPosition

public void setHeadPosition(int pos)
Sets the position (index column) of the head attribute in the exported data.

Parameters:
pos - [in] Head position