import java.util.*; import java.io.*; /** * The wordPair class defined objects containing two Strings. * The first String may be part part of the dictionary, to start with * and in this case the second String, i.e., the replacement String will * be null. Otherwise, the first String may be inserted into the dictionary * on request by the user in which case the replacement String will be non-null. * * @author Sriram Pemmaraju * @date Nov 13th, 2008 */ public class wordPair{ private String word; // The actual word, that acts a key to this object private String replacementWord; // Either null or an actual replacement word /** * Constructs a wordPair object, given a word; this sets the replacementWord to be * null */ public wordPair(String givenWord) { word = givenWord; replacementWord = null; } /** * Constructs a wordPair object, given a word and its replacement */ public wordPair(String givenWord, String givenReplacement) { word = givenWord; replacementWord = givenReplacement; } /** * This and the next method are needed, since I made the two String fields private * @return word */ String getWord() { return word; } /** * @return replacementWord */ String getReplacementWord() { return replacementWord; } }