dragon.onlinedb.amazon
Class AmazonReviewQuery

java.lang.Object
  |
  +--dragon.onlinedb.AbstractQuery
        |
        +--dragon.onlinedb.amazon.AmazonReviewQuery
All Implemented Interfaces:
ArticleQuery, CollectionReader

public class AmazonReviewQuery
extends AbstractQuery

Amazon reveiw query

Copyright: Copyright (c) 2005

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Field Summary
protected  Article[] arrArticle
           
protected  HttpUtil http
           
protected  java.lang.String queryKey
           
protected  java.lang.String reviewUrl
           
protected  java.lang.String term
           
protected  java.lang.String webEnv
           
 
Fields inherited from class dragon.onlinedb.AbstractQuery
articleNum, curArticle, curArticleNo, curPageNo, curPageWidth, pageNum, pageWidth, parser
 
Constructor Summary
AmazonReviewQuery()
           
AmazonReviewQuery(java.lang.String productCode)
           
 
Method Summary
protected  Article getArticle(int articleNo)
           
 Article getArticleByKey(java.lang.String PMID)
          Reads out the article according to its key
 boolean initQuery()
          One should call this method before retrieval articles.
static void main(java.lang.String[] args)
           
 boolean moveToPage(int pageNo)
          Move to the given page and the pointer is set on the first article of the page.
 void setSearchTerm(java.lang.String productCode)
          Set the searching terms.
 boolean supportArticleKeyRetrieval()
          if the query supports this retrieval mode, one can get articles by calling getArticleByKey method.
 
Methods inherited from class dragon.onlinedb.AbstractQuery
close, getArticle, getArticleKey, getArticleParser, getCurPageNo, getCurPageWidth, getNextArticle, getPageNum, getPageWidth, getTotalArticleNum, loadCollection, moveToArticle, moveToNextArticle, moveToNextPage, restart, setArticleParser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

webEnv

protected java.lang.String webEnv

queryKey

protected java.lang.String queryKey

term

protected java.lang.String term

reviewUrl

protected java.lang.String reviewUrl

arrArticle

protected Article[] arrArticle

http

protected HttpUtil http
Constructor Detail

AmazonReviewQuery

public AmazonReviewQuery(java.lang.String productCode)

AmazonReviewQuery

public AmazonReviewQuery()
Method Detail

main

public static void main(java.lang.String[] args)

supportArticleKeyRetrieval

public boolean supportArticleKeyRetrieval()
Description copied from interface: CollectionReader
if the query supports this retrieval mode, one can get articles by calling getArticleByKey method.

Returns:
true if the query support the article retrieval by key.

setSearchTerm

public void setSearchTerm(java.lang.String productCode)
Description copied from interface: ArticleQuery
Set the searching terms. How to interpret the terms specified in the string is subject to the implementations.


initQuery

public boolean initQuery()
Description copied from interface: ArticleQuery
One should call this method before retrieval articles. After initialization, number of pages and number of papers are available.

Returns:
a boolean value to indicate the operation is successful or failed.

moveToPage

public boolean moveToPage(int pageNo)
Description copied from interface: ArticleQuery
Move to the given page and the pointer is set on the first article of the page.

Parameters:
pageNo - the page #
Returns:
true if the given page exists.

getArticleByKey

public Article getArticleByKey(java.lang.String PMID)
Description copied from interface: CollectionReader
Reads out the article according to its key

Parameters:
PMID - the unique entry number of the article
Returns:
an article if exists

getArticle

protected Article getArticle(int articleNo)
Specified by:
getArticle in class AbstractQuery