TextDatabase
Class KeywordTreeSet

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

public class KeywordTreeSet
extends java.util.TreeSet

The KeywordTreeSet is a TreeSet of keywords

See Also:
Serialized Form

Field Summary
protected  Keyword _mostPopularKeyword
          Holds the keyword with the highest frequency
 
Constructor Summary
KeywordTreeSet()
           
 
Method Summary
 int addKeyword(java.lang.String string)
          Adds a keyword to the collection while managing the keyword's frequency and mantains the record of the most popular keyword
 boolean contains(java.lang.String KeywordName)
          Returns true if a keywordname exists in the tree set
 Keyword getKeyword(java.lang.String KeywordName)
          Gets the Keyword whose keyword name is KeywordName
 int getMostPopularKeywordFrequency()
          Returns the most popular keyword's frequency
 double getNormalizedFrequency(Keyword Keyword)
          Gets the normalized frequency of a keywordName Normalized Frequency = keyword's frequency / most popular keyword's frequency
 double getNormalizedFrequency(java.lang.String KeywordName)
          Gets the normalized frequency of a keywordName Normalized Frequency = keyword's frequency / most popular keyword's frequency
 
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
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Field Detail

_mostPopularKeyword

protected Keyword _mostPopularKeyword
Holds the keyword with the highest frequency

Constructor Detail

KeywordTreeSet

public KeywordTreeSet()
Method Detail

addKeyword

public int addKeyword(java.lang.String string)
Adds a keyword to the collection while managing the keyword's frequency and mantains the record of the most popular keyword


contains

public boolean contains(java.lang.String KeywordName)
Returns true if a keywordname exists in the tree set


getNormalizedFrequency

public double getNormalizedFrequency(java.lang.String KeywordName)
Gets the normalized frequency of a keywordName Normalized Frequency = keyword's frequency / most popular keyword's frequency


getNormalizedFrequency

public double getNormalizedFrequency(Keyword Keyword)
Gets the normalized frequency of a keywordName Normalized Frequency = keyword's frequency / most popular keyword's frequency


getMostPopularKeywordFrequency

public int getMostPopularKeywordFrequency()
Returns the most popular keyword's frequency


getKeyword

public Keyword getKeyword(java.lang.String KeywordName)
Gets the Keyword whose keyword name is KeywordName