kwic
Class Word

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

public class Word
extends Object

Represents the original and matching forms of a word. You must implement Object.hashCode() correctly as well as Object.equals(Object) for this to work.


Constructor Summary
Word(String w)
          Use the supplied String and a DefaultWordFilter filter.
Word(String word, kwic.WordCanonical wc)
           
 
Method Summary
 boolean equals(Object o)
          You must implement this right, see header note
 String getMatchWord()
          Returns the form of this word that should be used for matching
 String getOriginalWord()
          Returns the original form of this word
 int hashCode()
          You must implement this right, see header note
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Word

public Word(String word,
            kwic.WordCanonical wc)

Word

public Word(String w)
Use the supplied String and a DefaultWordFilter filter. For full credit, a new DefaultWordFilter should not be constructed for each Word using that filter. The trick is to use a static variable to avoid constructing superfluous DefaultWordFilters.

Method Detail

getMatchWord

public String getMatchWord()
Returns the form of this word that should be used for matching


getOriginalWord

public String getOriginalWord()
Returns the original form of this word


hashCode

public int hashCode()
You must implement this right, see header note

Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
You must implement this right, see header note

Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object