edu.nrao.sss.model.source.parser
Class GbtSourceCatalogReader

java.lang.Object
  extended by edu.nrao.sss.model.source.parser.AbstractSourceCatalogReader
      extended by edu.nrao.sss.model.source.parser.GbtSourceCatalogReader
All Implemented Interfaces:
SourceCatalogReader

public class GbtSourceCatalogReader
extends AbstractSourceCatalogReader

A parser of source catalog text files in the Green Bank Telescope's format. See the Users Guide for Astrid Source Catalogs for details on this format.

Version Info:

$Revision: 757 $
$Date: 2007-07-06 14:13:35 -0600 (Fri, 06 Jul 2007) $
$Author: dharland $ (last person to modify)

Since:
2006-11-17
Author:
David M. Harland

Field Summary
 
Fields inherited from class edu.nrao.sss.model.source.parser.AbstractSourceCatalogReader
catalog, errors, histRecPrefix, readWasSuccessful, sourceInfoOrigin
 
Constructor Summary
GbtSourceCatalogReader()
          Creates a new instance.
 
Method Summary
 String getError(int index)
          Returns the indexth error found during the most recent read.
 int getErrorCount()
          Returns the number of errors found during the most recent read.
 StringBuilder getErrors()
          Returns the combined text of all errors found during the most recent read.
 boolean read(Reader in, SourceCatalog destination)
          NOTE: This method closes the incoming Reader!
 
Methods inherited from class edu.nrao.sss.model.source.parser.AbstractSourceCatalogReader
getCatalog, getOriginOfSourceInformation, getPrefixForHistoricalRecords, getSuccess, putError, read, read, read, read, read, read, read, setOriginOfSourceInformation, setPrefixForHistoricalRecords
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GbtSourceCatalogReader

public GbtSourceCatalogReader()
Creates a new instance.

Method Detail

read

public boolean read(Reader in,
                    SourceCatalog destination)
NOTE: This method closes the incoming Reader!

Specified by:
read in interface SourceCatalogReader
Specified by:
read in class AbstractSourceCatalogReader
Parameters:
in - the source of text that can be read and turned into Source objects.
destination - the catalog to which the sources should be added. If this parameter is null, a new catalog will be created.
Returns:
true if nothing unexpected occurred while reading data.
See Also:
AbstractSourceCatalogReader.read(java.io.Reader, edu.nrao.sss.model.source.SourceCatalog)

getErrors

public StringBuilder getErrors()
Description copied from interface: SourceCatalogReader
Returns the combined text of all errors found during the most recent read.

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

Specified by:
getErrors in interface SourceCatalogReader
Overrides:
getErrors in class AbstractSourceCatalogReader
Returns:
the combined text of all errors found during the most recent read.
See Also:
SourceCatalogReader.getErrors()

getError

public String getError(int index)
Description copied from interface: SourceCatalogReader
Returns the indexth error found during the most recent read.

Specified by:
getError in interface SourceCatalogReader
Overrides:
getError in class AbstractSourceCatalogReader
Parameters:
index - a positional value >= zero and < SourceCatalogReader.getErrorCount().
Returns:
the indexth error found during the most recent read.
See Also:
SourceCatalogReader.getError(int)

getErrorCount

public int getErrorCount()
Description copied from interface: SourceCatalogReader
Returns the number of errors found during the most recent read.

Specified by:
getErrorCount in interface SourceCatalogReader
Overrides:
getErrorCount in class AbstractSourceCatalogReader
Returns:
the number of errors found during the most recent read.
See Also:
SourceCatalogReader.getErrorCount()


Copyright © 2009. All Rights Reserved.