org.jbox.searcher.simpleSearcher
Class PageProxy

java.lang.Object
  extended by org.jbox.dao.Page
      extended by org.jbox.searcher.simpleSearcher.PageProxy
All Implemented Interfaces:
java.io.Serializable

public class PageProxy
extends Page

A proxy of Page. This class is used to change the behavior of Page.getText(). It will return an introduction instead of returning the whole text of page. object.

Version:
1.0
Author:
YiBin.H
See Also:
Page, SimpleSearcher, Serialized Form

Constructor Summary
PageProxy()
          Constructs a new PageProxy object.
 
Method Summary
 void addLocation(java.util.Set<java.lang.Integer> location)
          Add locations of words in relative <@link Page> object.
 java.util.Set<java.lang.Integer> getLocation()
          Get locations of words in relative <@link Page> object.
 Page getPage()
          Return relative <@link Page> object.
 long getPageId()
          Get id of the relative <@link Page Page> object.
 java.lang.String getText()
          Return an introduction of page instead of returning a whole text of page.
 double getTFIDF()
          Get TFIDF of relative <@link Page> object.
 java.lang.String getTitle()
          Return title of relative <@link Page> object.
 java.lang.String getUrl()
          Return the URL of relative <@link Page> object.
 long getUrlId()
          Return id of relative <@link Page> object.
 int getWordNum()
          Return the words number of relative page.
 java.util.Collection<Word> getWords()
          Return a collection containing Word objects of Page.
 void setLocation(java.util.Set<java.lang.Integer> location)
          Set location of words to relative <@link Page> object.
 void setPage(Page page)
          Set a <@link Page> object to this PageProxy.
 void setPageId(long pageId)
          Set id of relative <@link Page> object.
 void setText(java.lang.String text)
          Set text to the relative <@link Page> object.
 void setTfidf(double tfidf)
          Set TFIDF of relative <@link Page> object.
 void setTitle(java.lang.String title)
          Set title to relative <@link Page> object.
 void setUrl(java.lang.String url)
          Set a URL to relative <@link Page> object.
 void setUrlId(long urlId)
          Set id to relative <@link Page> object.
 void setWordNum(int wordNum)
          Set words number to relative <@link Page> object.
 void setWords(java.util.Collection<Word> words)
          Set a collection containing Word object.
 java.lang.String toString()
          Return URL of relative <@link Page> object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PageProxy

public PageProxy()
Constructs a new PageProxy object.

Method Detail

setLocation

public void setLocation(java.util.Set<java.lang.Integer> location)
Set location of words to relative <@link Page> object.

Parameters:
location - locations of words in relative<@link Page> object.

getLocation

public java.util.Set<java.lang.Integer> getLocation()
Get locations of words in relative <@link Page> object.

Returns:
location locations of words in relative <@link Page Page> object.

addLocation

public void addLocation(java.util.Set<java.lang.Integer> location)
Add locations of words in relative <@link Page> object.


getPageId

public long getPageId()
Get id of the relative <@link Page Page> object.

Returns:
id of the relative <@link Page Page> object.

setPageId

public void setPageId(long pageId)
Set id of relative <@link Page> object.

Parameters:
pageId - id of relative <@link Page> object.

getTFIDF

public double getTFIDF()
Get TFIDF of relative <@link Page> object.

Returns:
TFIDF of relative <@link Page> object.

setTfidf

public void setTfidf(double tfidf)
Set TFIDF of relative <@link Page> object.

Parameters:
tfidf - TFIDF of relative <@link Page> object.

getText

public java.lang.String getText()
Return an introduction of page instead of returning a whole text of page. in Page.getText(). For example, suppose that the text of relative <@link Page> object is: "She has a dog. I have a dog too. John hasn't. He doesn't like dog.". Locations of word "dog" in the text is {0,1,3}, so the introduction is: "She has a dog...I have a dog too...He doesn't like dog...". If the size of locations is bigger than 3, it will just return the first three sentences in the text with locations.

Overrides:
getText in class Page
Returns:
introduction of relative page.

getPage

public Page getPage()
Return relative <@link Page> object.

Returns:
<@link Page> object.

setPage

public void setPage(Page page)
Set a <@link Page> object to this PageProxy.

Parameters:
page - <@link Page Page> object.

getTitle

public java.lang.String getTitle()
Return title of relative <@link Page> object.

Overrides:
getTitle in class Page
Returns:
title of relative <@link Page> object.

setTitle

public void setTitle(java.lang.String title)
Set title to relative <@link Page> object.

Overrides:
setTitle in class Page
Parameters:
title - String

getUrl

public java.lang.String getUrl()
Return the URL of relative <@link Page> object.

Overrides:
getUrl in class Page
Returns:
String representing a URL.

setUrl

public void setUrl(java.lang.String url)
Set a URL to relative <@link Page> object.

Overrides:
setUrl in class Page
Parameters:
url - String representing a URL.

setText

public void setText(java.lang.String text)
Set text to the relative <@link Page> object.

Overrides:
setText in class Page
Parameters:
text - String.

getWordNum

public int getWordNum()
Return the words number of relative page.

Overrides:
getWordNum in class Page
Returns:
words number of relative page.

setWordNum

public void setWordNum(int wordNum)
Set words number to relative <@link Page> object.

Overrides:
setWordNum in class Page
Parameters:
wordNum - Integer

getUrlId

public long getUrlId()
Return id of relative <@link Page> object.

Overrides:
getUrlId in class Page
Returns:
id of relative <@link Page> object.

setUrlId

public void setUrlId(long urlId)
Set id to relative <@link Page> object.

Overrides:
setUrlId in class Page
Parameters:
urlId - long value.

getWords

public java.util.Collection<Word> getWords()
Return a collection containing Word objects of Page.

Overrides:
getWords in class Page
Returns:
Collection containing Word objects.

setWords

public void setWords(java.util.Collection<Word> words)
Set a collection containing Word object. It should be noticed that the collection isn't updated to database when invoking PageHome.savePage(Page).

Overrides:
setWords in class Page
Parameters:
words - Collection containing Word objects.

toString

public java.lang.String toString()
Return URL of relative <@link Page> object.

Overrides:
toString in class Page
Returns:
string representing URL of the relative <@link Page> object.