|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iglu.ir.AbstractDocument
Implements some of the basic Document methods using a TermVector. Assumes that the document does not change. All that subclasses have to implement to complete a Document class are the getIndexibleContent, getFullContent, and getStylizedText methods. The get/set content methods here ensure that the document information is updated properly. Methods descended from this class should set the full and indexible content by calling the methods defined here rather than setting the variables directly.
Field Summary | |
private java.lang.String |
fullContent
|
private java.lang.String |
indexibleContent
|
private int |
size
|
private TermVector |
tv
Contains a list of words occurring and how often they occur |
Fields inherited from interface iglu.ir.Document |
STYLE_BOLD, STYLE_DEEMPHASIZED, STYLE_EMPHSIZED, STYLE_ITALIC |
Constructor Summary | |
AbstractDocument()
|
Method Summary | |
java.lang.String |
getFullContent()
Returns the unmodified contents of this document. |
java.lang.String |
getIndexibleContent()
Returns a string containing the content of this document which might be indexible. |
abstract java.lang.String |
getStylizedText(int style)
Allows the user to query the document about text which is highlighted in some way. |
private void |
loadTermVector()
|
int |
numOccurs(java.lang.String w)
The number of times w occurs in the indexible content. |
int |
numUniqueWords()
The number of unique words in the indexible content of the document. |
int |
numWords()
The number of total words in the document. |
void |
setFullContent(java.lang.String content)
|
void |
setIndexibleContent(java.lang.String content)
Changes the indexible content of the current document to content . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.lang.String fullContent
private java.lang.String indexibleContent
private TermVector tv
private int size
Constructor Detail |
public AbstractDocument()
Method Detail |
public abstract java.lang.String getStylizedText(int style)
Document
getStylizedText
in interface Document
style
- an int
value
String
valuepublic java.lang.String getFullContent()
Document
getFullContent
in interface Document
String
valuepublic java.lang.String getIndexibleContent()
Document
getIndexibleContent
in interface Document
String
valuepublic void setIndexibleContent(java.lang.String content)
Document
content
. Can be used by the DocumentFilters
to change the content.
setIndexibleContent
in interface Document
public void setFullContent(java.lang.String content)
public int numOccurs(java.lang.String w)
Document
numOccurs
in interface Document
w
- a String
value
int
valuepublic int numWords()
Document
numWords
in interface Document
int
valuepublic int numUniqueWords()
Document
numUniqueWords
in interface Document
int
valueprivate void loadTermVector()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |