apollo.dataadapter.chado
Class ChadoAdHocFlatFileWriter

java.lang.Object
  extended by apollo.dataadapter.chado.ChadoAdHocFlatFileWriter

public class ChadoAdHocFlatFileWriter
extends java.lang.Object

Writes a curation set to an ad-hoc chado-based flat file format. Used primarily for chado roundtrip test suite; note that this class is not guaranteed to write *all* of Apollo's state to the file, but it should write at least as much as was read from the chado database by the JdbcChadoAdapter.

Author:
jcrabtree@sourceforge.net

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
ChadoAdHocFlatFileWriter()
           
 
Method Summary
 boolean write(java.lang.String filename, CurationSet cs)
           
protected  void writeCurationSet(java.io.PrintWriter pw, CurationSet cs)
           
protected  void writeCurationSets(java.io.PrintWriter pw, java.util.HashMap cs)
           
protected  void writeFeatureSet(java.io.PrintWriter pw, FeatureSetI fs)
           
protected  void writeSeqFeature(java.io.PrintWriter pw, SeqFeatureI sf)
           
protected  void writeSequence(java.io.PrintWriter pw, SequenceI seq)
           
protected  void writeSequences(java.io.PrintWriter pw, java.util.Vector seqs)
           
protected  void writeStrandedFeatureSet(java.io.PrintWriter pw, StrandedFeatureSetI sfs)
           
protected  void writeTransactions(java.io.PrintWriter pw, TransactionManager tm)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

ChadoAdHocFlatFileWriter

public ChadoAdHocFlatFileWriter()
Method Detail

write

public boolean write(java.lang.String filename,
                     CurationSet cs)
Parameters:
filename - The name of the file to write to.
cs - The CurationSet whose data is to be written.
Returns:
whether the write succeeded

writeCurationSet

protected void writeCurationSet(java.io.PrintWriter pw,
                                CurationSet cs)
Parameters:
pw - Where to write the flat file output.
cs - The CurationSet to write.

writeStrandedFeatureSet

protected void writeStrandedFeatureSet(java.io.PrintWriter pw,
                                       StrandedFeatureSetI sfs)
Parameters:
pw - Where to write the flat file output.
sfs - The StrandedFeatureSetI to write.

writeFeatureSet

protected void writeFeatureSet(java.io.PrintWriter pw,
                               FeatureSetI fs)
Parameters:
pw - Where to write the flat file output.
fs - The FeatureSetI to write.

writeSeqFeature

protected void writeSeqFeature(java.io.PrintWriter pw,
                               SeqFeatureI sf)
Parameters:
pw - Where to write the flat file output.
sf - The SeqFeatureI to write.

writeSequences

protected void writeSequences(java.io.PrintWriter pw,
                              java.util.Vector seqs)
Parameters:
pw - Where to write the flat file output.
sfs - Vector of SequenceI

writeSequence

protected void writeSequence(java.io.PrintWriter pw,
                             SequenceI seq)

writeTransactions

protected void writeTransactions(java.io.PrintWriter pw,
                                 TransactionManager tm)
Parameters:
pw - Where to write the flat file output.
tm - TransactionManager.

writeCurationSets

protected void writeCurationSets(java.io.PrintWriter pw,
                                 java.util.HashMap cs)
Parameters:
pw - Where to write the flat file output.
cs - HashMap of child curation sets.