dragon.onlinedb
Interface ArticleQuery

All Superinterfaces:
CollectionReader
All Known Implementing Classes:
AbstractQuery

public interface ArticleQuery
extends CollectionReader

An interface for online document retrieval

Copyright: Copyright (c) 2003

Company: IST, Drexel University

Version:
1.0
Author:
Davis Zhou

Method Summary
 Article getArticle()
          read out the article the current pointer points to.
 java.lang.String getArticleKey()
          In some cases, retrieval of an article is very expensive.
 int getCurPageNo()
           
 int getCurPageWidth()
           
 int getPageNum()
           
 int getPageWidth()
           
 int getTotalArticleNum()
           
 boolean initQuery()
          One should call this method before retrieval articles.
 boolean moveToArticle(int indexInPage)
          Move the pointer to the give position of the current page.
 boolean moveToNextArticle()
          The pointer will be set on the next article.
 boolean moveToNextPage()
          Move to the next page and the pointer is set on the first article of the page.
 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 terms)
          Set the searching terms.
 
Methods inherited from interface dragon.onlinedb.CollectionReader
close, getArticleByKey, getArticleParser, getNextArticle, restart, setArticleParser, supportArticleKeyRetrieval
 

Method Detail

initQuery

public boolean initQuery()
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.

setSearchTerm

public void setSearchTerm(java.lang.String terms)
Set the searching terms. How to interpret the terms specified in the string is subject to the implementations.


moveToNextPage

public boolean moveToNextPage()
Move to the next page and the pointer is set on the first article of the page.

Returns:
false if it reached the last page already.

moveToPage

public boolean moveToPage(int pageNo)
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.

getTotalArticleNum

public int getTotalArticleNum()

getPageNum

public int getPageNum()

getPageWidth

public int getPageWidth()

getCurPageWidth

public int getCurPageWidth()
Returns:
number of papers in the current page.

getCurPageNo

public int getCurPageNo()

moveToNextArticle

public boolean moveToNextArticle()
The pointer will be set on the next article. After call the method of initQuery, one should call this method before you call getArticle to get the first article.

Returns:
true if the current pointer is not on the last article.

moveToArticle

public boolean moveToArticle(int indexInPage)
Move the pointer to the give position of the current page.

Parameters:
indexInPage - the position of the article in the current page.
Returns:
true if the position is within the scope of the current page.

getArticleKey

public java.lang.String getArticleKey()
In some cases, retrieval of an article is very expensive. Thus, one may check the key (unique document entry number) first. If the article is of interest, one will retrieve this article.

Returns:
the key of the article the current pointer points to.

getArticle

public Article getArticle()
read out the article the current pointer points to.

Returns:
an article