mapmaker package

Package Contract

The mapmaker package contains classes that further analyze the page passed by the filter. After the filter passes the PageAttribute object to the Mapmaker class, it will instantiate a new Analyzer object to further analyzer the page. After the Mapmaker finishes the analysis, it will pass the PageAttribute object to webpageDB.

Package-Level CRC

notifier, filters, webpageDB

Analyze the PageAttribute received from a Filter.
Decide the values of all the attributes and other information from PageInfo.
Pass PageAttribute objects to the Webpage Database.

Class-Level CRCs

Specific classes in the Mapmaker Package

* Analyzer
* Mapmaker
* Notifier

Class Analyzer

* Responsibilities:
Parse a page given by the Filter and check each attribute in the PageAttribute object. Find variables of the PageAttribute that haven't been analyzed, analyze them, and insert appropriate values into the PageAttribute object.
* Collaborators:
Mapmaker will call the Analyzer, passing it a new PageAttribute that has been received from a Filter. Mapmaker will insert the returned PageAttribute into the Webpage Database using the insert() method.
* Variables and Methods:
public Analyzer(PageAttribute pageAttribute)
There will be one instance of an Analyzer for each new PageAttribute.
private PageAttribute Analyze(DataInputStream htmlPage)
This method will check all the attribute in PageAttribute object, analyze the HTML page and fill in appropriate values.

Class Mapmaker

* Responsibilities:
This class monitors the overall activity of this package. An instance of Mapmaker is instantiated when the system starts up; it is woken up by the Notifier when a new PageAttribute is available from one of the Filters.
* Collaborators:
notifier, webpageDB
* Variables and Methods:
public Mapmaker implements Notifier
the constructor of the Mapmaker class, will be called when the system starts up
public void notify (Object o)
Whenever there is a new PageInfo available, Filter calls notify() to notify Mapmaker an event happened.

Message Interactions

Between packages
Between Filter and Mapmaker
Package Mapmaker will get a PageAttribute object from Filter, check each attribute in PageAttribute object and fill in appropriate values.
Between Webpage Database and Mapmaker
Mapmaker will call the insert() method provided by webpageDB to insert the PageAttribute object.
Within the package
Between Mapmaker and Analyzer
Whenever the Mapmaker.notify() method has been called with a new PageAttribute object, Mapmaker invokes a new Analyzer object to analyze the new page, parsing it, and filling in all the variables with appropriate values. When one Analyzer finish analyzing the page, it will return an PageAttribute object which the Mapmaker will pass to the webpageDB package.
Between Analyzer and PageAttribute
By running an appropriate algorithm, the Analyzer fill in values to PageAttribute variables.

last | | to sitemap | | up one level | | next