gov.nih.nci.caarray.services.util.parse
Class DelimitedExporter

java.lang.Object
  extended by gov.nih.nci.caarray.services.util.parse.DelimitedExporter

public class DelimitedExporter
extends java.lang.Object

Author:
gustafsons A junky little class to write out the internal tables (basically arrays of apache dynabeans for our friends who write code in R. To use this class the array of your classes (must be java beans) to the InternalTable class and specify the column order you want them to be printed out in.

Constructor Summary
DelimitedExporter()
           
 
Method Summary
 void closeStream()
           
 java.lang.String getTheDelimiter()
          Returns the theDelimiter.
 java.lang.String getTheFileName()
          Returns the fileName.
 InternalTable getTheTable()
          Returns the theTable.
 boolean isIncludeHeaders()
          Returns the includeHeaders.
static void main(java.lang.String[] args)
           
 void setIncludeHeaders(boolean includeHeaders)
          Sets the includeHeaders.
 void setTheDelimiter(java.lang.String delimiter)
          Sets the theDelimiter.
 void setTheFileName(java.lang.String fileName)
          Sets the fileName.
 void setTheTable(InternalTable theTable)
          Sets the theTable.
 void streamBean(LocalDynaBean bean)
          Streams a bean to the file
 void streamRecords()
          To save memory you can use the streaming methods 1.
 void writeFile()
          Method writeFile for non streaming.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelimitedExporter

public DelimitedExporter()
Method Detail

main

public static void main(java.lang.String[] args)

getTheFileName

public java.lang.String getTheFileName()
Returns the fileName.

Returns:
String

getTheTable

public InternalTable getTheTable()
Returns the theTable.

Returns:
InternalTable

setTheFileName

public void setTheFileName(java.lang.String fileName)
Sets the fileName.

Parameters:
fileName - The fileName to set

setTheTable

public void setTheTable(InternalTable theTable)
Sets the theTable.

Parameters:
theTable - The theTable to set

getTheDelimiter

public java.lang.String getTheDelimiter()
Returns the theDelimiter.

Returns:
String

setTheDelimiter

public void setTheDelimiter(java.lang.String delimiter)
Sets the theDelimiter.

Parameters:
theDelimiter - The theDelimiter to set

streamRecords

public void streamRecords()
                   throws GeneralException
To save memory you can use the streaming methods 1. Start with call to streamRecords 2. For each dynabean run streamBean 3. Close with closeStream

Throws:
GeneralException

streamBean

public void streamBean(LocalDynaBean bean)
Streams a bean to the file

Parameters:
bean -

closeStream

public void closeStream()

writeFile

public void writeFile()
               throws GeneralException
Method writeFile for non streaming.

Throws:
GeneralException

isIncludeHeaders

public boolean isIncludeHeaders()
Returns the includeHeaders.

Returns:
boolean

setIncludeHeaders

public void setIncludeHeaders(boolean includeHeaders)
Sets the includeHeaders.

Parameters:
includeHeaders - The includeHeaders to set