TextDatabase
Class Document

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.TreeSet
              extended by TextDatabase.KeywordTreeSet
                  extended by TextDatabase.Document
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, java.lang.Iterable, java.util.Collection, java.util.Set, java.util.SortedSet

public class Document
extends KeywordTreeSet
implements java.lang.Comparable

The Document is a tree set of keywords

See Also:
Serialized Form

Field Summary
 
Fields inherited from class TextDatabase.KeywordTreeSet
_mostPopularKeyword
 
Constructor Summary
Document(DocumentTreeSet DocumentTreeSet, java.lang.String FileName)
          Initializes the Document from a file
 
Method Summary
 int compareTo(java.lang.Object Obj)
          Compares the Document to another document
 boolean equals(java.lang.Object Obj)
          Checks if the Document is equal to another Document
 java.lang.String getFileName()
          Gets the Document filename
 double getTermWeight(Keyword Keyword, double InverseFrequency)
          Get's the weight of a term for the specified document
 double getTermWeight(java.lang.String KeywordName, double InverseFrequency)
          Gets the weight of term for the specifeid document.
 java.lang.String getText()
          Returns the document's filename contents
 boolean isRelevant(Query Query)
          Checks if a document is relevant to a query by evaluating the keywords and the operands of the query
 void setFileName(java.lang.String FileName)
          Sets the document's filename and keyword tree set
 java.lang.String toString()
          Returns the documents filename
 java.util.Vector toVector()
          Vectorizes the contents of the tree set
 
Methods inherited from class TextDatabase.KeywordTreeSet
addKeyword, contains, getKeyword, getMostPopularKeywordFrequency, getNormalizedFrequency, getNormalizedFrequency
 
Methods inherited from class java.util.TreeSet
add, addAll, clear, clone, comparator, contains, first, headSet, isEmpty, iterator, last, remove, size, subSet, tailSet
 
Methods inherited from class java.util.AbstractSet
hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
containsAll, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

Document

public Document(DocumentTreeSet DocumentTreeSet,
                java.lang.String FileName)
Initializes the Document from a file

Method Detail

getFileName

public java.lang.String getFileName()
Gets the Document filename


setFileName

public void setFileName(java.lang.String FileName)
Sets the document's filename and keyword tree set


compareTo

public int compareTo(java.lang.Object Obj)
Compares the Document to another document

Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object Obj)
Checks if the Document is equal to another Document

Specified by:
equals in interface java.util.Collection
Specified by:
equals in interface java.util.Set
Overrides:
equals in class java.util.AbstractSet

isRelevant

public boolean isRelevant(Query Query)
Checks if a document is relevant to a query by evaluating the keywords and the operands of the query


toString

public java.lang.String toString()
Returns the documents filename

Overrides:
toString in class java.util.AbstractCollection

getText

public java.lang.String getText()
Returns the document's filename contents


toVector

public java.util.Vector toVector()
Vectorizes the contents of the tree set


getTermWeight

public double getTermWeight(Keyword Keyword,
                            double InverseFrequency)
Get's the weight of a term for the specified document


getTermWeight

public double getTermWeight(java.lang.String KeywordName,
                            double InverseFrequency)
Gets the weight of term for the specifeid document. DocumentTermWeight = term's normalized frequency(document) * term's inverse document frequency