import element.*; public class Word { private String theWord; // the word to be tallied private int theCount; // its frequency public Word(String w) // post: construct a word entry from the string w { theWord = new String(w); theCount = 1; // saw it at least once! } public String value() { return new String(theWord); } public void encounter() // post: the frequency of the word is incremented { theCount++; } public boolean equals(String s) // pre: s is non-null // post: returns true iff the word within is equal to s { return theWord.equals(s); } public String toString() // post: return a string representation of a word entry { return ""; } }