kwic
Class KWIC

java.lang.Object
  |
  +--kwic.KWIC

public class KWIC
extends Object

Key Word in Context


Field Summary
protected  HashMap map
           
protected  PropertyChangeSupport pcs
           
 
Constructor Summary
KWIC()
           
 
Method Summary
 void addPhrase(kwic.Phrase p)
          For each Word in the Phrase, add the Word to the association.
 void addPhrase(String s)
          Convenient interface
 void deletePhrase(kwic.Phrase p)
          For each word in the Phrase, delete the association between the word and the phrase.
 void deleteWord(kwic.Word w)
          Drop a word completely from the KWIC
 void dropAssoc(kwic.Word w, kwic.Phrase p)
          Drop the association between the specified Word and Phrase, if any
 void forceAssoc(kwic.Word w, kwic.Phrase p)
          Force a mapping between the speicified Word and Phrase
 PropertyChangeSupport getPCS()
          Required for part (b) of this lab.
 Iterator getPhrases(kwic.Word w)
          Return an Iterator that provides each Phrase associated with the specified Word.
 Iterator getWords()
          Rerturn an iterator of all words
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pcs

protected PropertyChangeSupport pcs

map

protected HashMap map
Constructor Detail

KWIC

public KWIC()
Method Detail

getPCS

public PropertyChangeSupport getPCS()
Required for part (b) of this lab. Accessor for the PropertyChangeSuppport object that notifies upon modification.


addPhrase

public void addPhrase(String s)
Convenient interface


addPhrase

public void addPhrase(kwic.Phrase p)
For each Word in the Phrase, add the Word to the association. Use reduction to forceAssoc(Word, Phrase).


deletePhrase

public void deletePhrase(kwic.Phrase p)
For each word in the Phrase, delete the association between the word and the phrase. Use reduction to dropAssoc(Word, Phrase).


forceAssoc

public void forceAssoc(kwic.Word w,
                       kwic.Phrase p)
Force a mapping between the speicified Word and Phrase


dropAssoc

public void dropAssoc(kwic.Word w,
                      kwic.Phrase p)
Drop the association between the specified Word and Phrase, if any


getPhrases

public Iterator getPhrases(kwic.Word w)
Return an Iterator that provides each Phrase associated with the specified Word.


deleteWord

public void deleteWord(kwic.Word w)
Drop a word completely from the KWIC


getWords

public Iterator getWords()
Rerturn an iterator of all words