edu.nrao.sss.model.source.parser
Interface SourceCatalogWriter

All Known Implementing Classes:
AbstractSourceCatalogWriter, PstSourceCatalogWriter, XmlSourceCatalogWriter

public interface SourceCatalogWriter

A writer that converts source catalogs to a text format.

CVS Info:

$Revision: 714 $
$Date: 2007-06-13 10:36:05 -0600 (Wed, 13 Jun 2007) $
$Author: btruitt $


Method Summary
 String getError(int index)
          Returns the indexth error found during the most recent write.
 int getErrorCount()
          Returns the number of errors found during the most recent write.
 StringBuilder getErrors()
          Returns the combined text of all errors found during the most recent write.
 boolean getSuccess()
          Returns true if the most recently read data caused no parsing errors.
 boolean write(SourceCatalog cat, OutputStream out)
          Writes the sources in cat to the OutputStream out.
 boolean write(SourceCatalog cat, OutputStream out, FileCompressionFormat format)
          Writes the sources in cat to the OutputStream out.
 boolean write(SourceCatalog cat, String fileName)
          Writes the sources in cat to a file
 boolean write(SourceCatalog cat, Writer out)
          Writes the sources in cat to the Writer out.
 

Method Detail

write

boolean write(SourceCatalog cat,
              String fileName)
Writes the sources in cat to a file

Parameters:
fileName - the name of a file.
cat - the catalog of sources to output
Returns:
true if nothing unexpected occurred while writing data.
See Also:
write(SourceCatalog, Writer)

write

boolean write(SourceCatalog cat,
              Writer out)
Writes the sources in cat to the Writer out.

Parameters:
out - the destination of the text representation.
cat - the catalog of sources to output
Returns:
true if nothing unexpected occurred while reading data.
Throws:
NullPointerException - if cat is NULL.
See Also:
getErrors()

write

boolean write(SourceCatalog cat,
              OutputStream out)
Writes the sources in cat to the OutputStream out.

Parameters:
out - the destination of the text representation.
cat - the catalog of sources to output
Returns:
true if nothing unexpected occurred while reading data.
See Also:
write(SourceCatalog, OutputStream, FileCompressionFormat)

write

boolean write(SourceCatalog cat,
              OutputStream out,
              FileCompressionFormat format)
Writes the sources in cat to the OutputStream out. If format is specified, non-null, and not equal to UNCOMPRESSED the data should be compressed before being written to out.

Parameters:
cat - the source of sources that can be written out in a text format.
out - the OutputStream to which the sources should be written.
format - determines what kind of compression, if any, that should be used.
Returns:
true if nothing unexpected occurred while reading data.
See Also:
getErrors()

getSuccess

boolean getSuccess()
Returns true if the most recently read data caused no parsing errors. Note that the SourceCatalog created by this reader may be perfectly fine even if this method returns false.

Returns:
true if there were no incidents during the most recent read.

getErrors

StringBuilder getErrors()
Returns the combined text of all errors found during the most recent write.

Note that an "error" is anything unexpected encountered while writing. Not all errors are harmful. The text of each error includes the line number where it occurred and an explanation of what was wrong.

Returns:
the combined text of all errors found during the most recent write.

getError

String getError(int index)
Returns the indexth error found during the most recent write.

Parameters:
index - a positional value >= zero and < getErrorCount().
Returns:
the indexth error found during the most recent write.
See Also:
getErrors()

getErrorCount

int getErrorCount()
Returns the number of errors found during the most recent write.

Returns:
the number of errors found during the most recent write.
See Also:
getErrors()


Copyright © 2009. All Rights Reserved.