- 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.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- The default creator. Sets class variables to default values.
public void populateWordList(String fileName)
- 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.
fileName - The name of the file that contains the word list
true if the word list is successfully populated,
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.
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.