bill.apps.wordedit
Class RemoveWords

java.lang.Object
  |
  +--bill.apps.wordedit.RemoveWords

public class RemoveWords
extends Object

This class is used to control the removing of existing words from the word list. It accepts input from stdin (typically the keyboard). If a word is at least three characters long it attempts to remove it from the word list. If the word oes not exist nothing happens, otherwise it is removed from the list. If a word of two or fewer characters is entered, then the current word list is saved to a file.


Constructor Summary
RemoveWords()
          The default creator.
 
Method Summary
 void getWordsFromStdin()
          Gets words from stdin.
static void main(String[] args)
          Controls the running of the RemoveWords class.
 void populateWordList(String fileName)
          Controls the population of the class's word list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoveWords

public RemoveWords()
The default creator. Sets class variables to default values.
Method Detail

populateWordList

public void populateWordList(String fileName)
                      throws Exception
Controls the population of the class's word list. This is done by creating the object which will hold the list and then calling a method to populate the object.
Parameters:
fileName - The name of the file that contains the word list
Returns:
true if the word list is successfully populated, false otherwise.

getWordsFromStdin

public void getWordsFromStdin()
Gets words from stdin. Reads a character at a time until an end of line or form feed is read, which signifies the end of a word. If the word is at least three characters long it is removed from the word list.

main

public static void main(String[] args)
Controls the running of the RemoveWords class. Reads in the current word list, then calls getWordsFromStdin to allow the user to remove words from the word list.