kwic
Class Word

java.lang.Object
  extended by 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)
          Represent a word of a Phrase
 
Method Summary
 boolean equals(Object o)
          You must implement this so that two words equal each other if their matched forms equal each other.
 String getMatchWord()
          The word used for matching is the original word run throgh the WordCanonical filter.
 String getOriginalWord()
           
 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 w)
Represent a word of a Phrase

Parameters:
w - The original word
Method Detail

getMatchWord

public String getMatchWord()
The word used for matching is the original word run throgh the WordCanonical filter.

Returns:
the form of the word used for matching.

getOriginalWord

public String getOriginalWord()
Returns:
the original 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 so that two words equal each other if their matched forms equal each other. You can let eclipse generate this method automatically, but you have to modify the resulting code to get the desired effect.

Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object
Returns:
the word and its matching form, if different