gov.nih.nlm.mms.cxt
Class MRCXTBuilderOutputStream

java.lang.Object
  extended by gov.nih.nlm.umls.io.RichMRFilesConceptInputStream
      extended by gov.nih.nlm.mms.cxt.MRCXTBuilderOutputStream
All Implemented Interfaces:
ConceptInputStream, LocalNullValueSupport

public class MRCXTBuilderOutputStream
extends RichMRFilesConceptInputStream

Builds MRCXT.RRF from MRHIER.RRF and MRCONSO.RRF with the help of a few indexes. Manages the log.

Author:
Deborah Shapiro

Field Summary
 
Fields inherited from class gov.nih.nlm.umls.io.RichMRFilesConceptInputStream
add_suffix, atom_hm, file_names, from_rsab, from_vsab, install_paths, mrcoc_source, mrconso_counter, mrconso_lines, mrconso_source, mrcxt_source, mrdef_source, mrdoc_source, mrhier_source, mrhist_source, mrmap_source, mrrel_source, mrsat_source, mrsty_source, null_value, rel_hm, this_concept, to_rsab, to_vsab, tokens, warnings
 
Constructor Summary
MRCXTBuilderOutputStream(MRCXTBuilder mrcxt_builder)
          Instantiates an empty MRCXTBuilderOutputStream.
 
Method Summary
protected  String getColumnTextFromFileStatistics(FileStatistics file_stats)
          Returns the MRCOLS.RRF lines for the specified FileStatistics.
protected  float getDecimalProgress()
          Returns the percentage of the MRHIER.RRF file that has been converted and written to MRCXT.RRF.
protected  String getFileTextFromFileStatistics(FileStatistics file_stats)
          Returns the MRFILES.RRF line for the specified FileStatistics.
protected  int getProgress()
          Returns the percentage of the MRHIER.RRF file that has been converted and written to MRCXT.RRF.
 boolean isCancelled()
          Indicates whether or not the license agreement was cancelled or not accepted.
protected  void openMRFiles()
          Opens the Rich Release Format MR files.
protected  BufferedWriter openTargetFile(String name)
          Opens the specified file in the MRCXT Builder source directory.
protected  void writeFileColumnStats()
          This method computes the file and columns statistics for the MRFILES.RRF and MRCOLS.RRF files themselves.
 void writeMRCXT(ProgressMonitor pm)
          Writes MRCXT.RRF Should be called from a separate thread.
 
Methods inherited from class gov.nih.nlm.umls.io.RichMRFilesConceptInputStream
close, getAtoms, getAttributes, getComponentHistories, getConceptProgress, getContexts, getCoocurrences, getDefinitions, getLineCounts, getMappings, getNullValue, getRelationships, getSemanticTypes, getWarnings, isEmptyValue, newInstanceFromMRCOC, newInstanceFromMRCONSO, newInstanceFromMRCXTRel, newInstanceFromMRDEF, newInstanceFromMRHIER, newInstanceFromMRHIST, newInstanceFromMRMAP, newInstanceFromMRREL, newInstanceFromMRSAT, newInstanceFromMRSTY, open, openSourceFile, readConcept, setAdditionalSuffix, setNullValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MRCXTBuilderOutputStream

public MRCXTBuilderOutputStream(MRCXTBuilder mrcxt_builder)
Instantiates an empty MRCXTBuilderOutputStream.

Parameters:
mrcxt_builder - MRCXTBuilder
Method Detail

writeMRCXT

public void writeMRCXT(ProgressMonitor pm)
                throws Exception
Writes MRCXT.RRF Should be called from a separate thread.

Parameters:
pm - the ProgressMonitor
Throws:
Exception - if anything goes wrong

isCancelled

public boolean isCancelled()
Indicates whether or not the license agreement was cancelled or not accepted.

Returns:
true if the GUI was cancelled, false otherwise

getProgress

protected int getProgress()
Returns the percentage of the MRHIER.RRF file that has been converted and written to MRCXT.RRF.

Returns:
int percentage

getDecimalProgress

protected float getDecimalProgress()
Returns the percentage of the MRHIER.RRF file that has been converted and written to MRCXT.RRF.

Returns:
float percentage

openMRFiles

protected void openMRFiles()
                    throws IOException
Opens the Rich Release Format MR files.

Overrides:
openMRFiles in class RichMRFilesConceptInputStream
Throws:
IOException - if any files cannot be opened

writeFileColumnStats

protected void writeFileColumnStats()
                             throws IOException
This method computes the file and columns statistics for the MRFILES.RRF and MRCOLS.RRF files themselves. Should it be using "\n"?

Throws:
IOException - if anything goes wrong

getFileTextFromFileStatistics

protected String getFileTextFromFileStatistics(FileStatistics file_stats)
Returns the MRFILES.RRF line for the specified FileStatistics.

Parameters:
file_stats - the FileStatistics
Returns:
the MRFILES.RRF line for the specified FileStatistics

getColumnTextFromFileStatistics

protected String getColumnTextFromFileStatistics(FileStatistics file_stats)
Returns the MRCOLS.RRF lines for the specified FileStatistics.

Parameters:
file_stats - the FileStatistics
Returns:
the MRCOLS.RRF lines for the specified FileStatistics

openTargetFile

protected BufferedWriter openTargetFile(String name)
                                 throws IOException
Opens the specified file in the MRCXT Builder source directory.

Parameters:
name - the filename
Returns:
a BufferedWriter for the file
Throws:
IOException - if the file could not be opened.


Copyright ©2005