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

java.lang.Object
  extended by edu.nrao.sss.model.source.parser.Astro2007aHtmlTableReader

public class Astro2007aHtmlTableReader
extends Object

A reader that can turn HTML in the form presented in the 2007a Astro Catalogue into sources.

Warning: This reader is not an industrial strength class and was intended for use by those who are not overly concerned with the failure to read the HTML. The main problem with this class is that several exceptions are stifled and do not reach clients of this class.

Version Info:

$Revision$
$Date$
$Author$ (last person to modify)

Since:
2007-06-20
Author:
David M. Harland

Constructor Summary
Astro2007aHtmlTableReader()
          Creates a new reader of the catalog found at http://vlbi.gsfc.nasa.gov/solutions/2007a_astro/2007a_astro_cat.html.
Astro2007aHtmlTableReader(String pageName, int firstDataRow)
          Creates a new reader of the catalog found at the URL pageName.
 
Method Summary
 boolean addFileBrightnessesTo(Source source)
          Adds to source any file-based brightnesses contained in this reader that are associated with a source of the same name.
 boolean addFileBrightnessesTo(SourceCatalog catalog)
          Adds to the sources in catalog any file-based brightnesses contained in this reader that are associated with sources of the same name.
 boolean addImageLinksTo(Source source)
          Adds to source any image links contained in this reader that are associated with a source of the same name.
 boolean addImageLinksTo(SourceCatalog catalog)
          Adds to the sources in catalog any image links contained in this reader that are associated with sources of the same name.
 boolean addLinksTo(Source source)
          Adds to source any informational links contained in this reader that are associated with a source of the same name.
 boolean addLinksTo(SourceCatalog catalog)
          Adds to the sources in catalog any informational links contained in this reader that are associated with sources of the same name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Astro2007aHtmlTableReader

public Astro2007aHtmlTableReader()
                          throws MalformedURLException,
                                 IOException
Creates a new reader of the catalog found at http://vlbi.gsfc.nasa.gov/solutions/2007a_astro/2007a_astro_cat.html.

Throws:
MalformedURLException - if the above URL is malformed.
IOException - if the page at the above URL cannot be read.

Astro2007aHtmlTableReader

public Astro2007aHtmlTableReader(String pageName,
                                 int firstDataRow)
                          throws MalformedURLException,
                                 IOException
Creates a new reader of the catalog found at the URL pageName.

Parameters:
pageName - the URL for a catalog in 2007a Astro form.
firstDataRow - the first row of the HTML table found at pageName that contains source data. Indexing starts at zero. Often the first two (indices 0 and 1) rows contain column headers.
Throws:
MalformedURLException - if pageName cannot be turned into a URL.
IOException - if pageName cannot be read.
Method Detail

addImageLinksTo

public boolean addImageLinksTo(Source source)
Adds to source any image links contained in this reader that are associated with a source of the same name.

Parameters:
source - the source to which links might be added.
Returns:
true if one or more links were added.

addImageLinksTo

public boolean addImageLinksTo(SourceCatalog catalog)
Adds to the sources in catalog any image links contained in this reader that are associated with sources of the same name. This is a convenience method that iterates through the sources of catalog and calls addImageLinksTo(Source).

Parameters:
catalog - the catalog holding sources to which links might be added.
Returns:
true if one or more links were added.

addLinksTo

public boolean addLinksTo(Source source)
Adds to source any informational links contained in this reader that are associated with a source of the same name.

Parameters:
source - the source to which links might be added.
Returns:
true if one or more links were added.

addLinksTo

public boolean addLinksTo(SourceCatalog catalog)
Adds to the sources in catalog any informational links contained in this reader that are associated with sources of the same name. This is a convenience method that iterates through the sources of catalog and calls addImageLinksTo(Source).

Parameters:
catalog - the catalog holding sources to which links might be added.
Returns:
true if one or more links were added.

addFileBrightnessesTo

public boolean addFileBrightnessesTo(Source source)
Adds to source any file-based brightnesses contained in this reader that are associated with a source of the same name.

Parameters:
source - the source to which brightnesses might be added.
Returns:
true if one or more brightnesses were added.

addFileBrightnessesTo

public boolean addFileBrightnessesTo(SourceCatalog catalog)
Adds to the sources in catalog any file-based brightnesses contained in this reader that are associated with sources of the same name. This is a convenience method that iterates through the sources of catalog and calls addFileBrightnessesTo(Source).

Parameters:
catalog - the catalog holding sources to which brightnesses might be added.
Returns:
true if one or more brightnesses were added.


Copyright © 2009. All Rights Reserved.