|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.dictionary.WordListDictionary
public class WordListDictionary
WordListDictionary provides fast searching for dictionary words
using a WordList. It's critical that the word list provided to
this dictionary be sorted according to the natural ordering of String.
| Field Summary | |
|---|---|
protected WordList |
wordList
list used for searching. |
| Constructor Summary | |
|---|---|
WordListDictionary(WordList wl)
Creates a new dictionary instance from the given WordList. |
|
| Method Summary | |
|---|---|
WordList |
getWordList()
Returns the word list to used for searching. |
static void |
main(java.lang.String[] args)
This provides command line access to this WordListDictionary. |
boolean |
search(java.lang.String word)
Returns whether the supplied word exists in the dictionary. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected WordList wordList
| Constructor Detail |
|---|
public WordListDictionary(WordList wl)
WordList.
wl - List of words sorted according to WordList.getComparator().
NOTE Failure to provide a sorted word list will produce incorrect results.
| Method Detail |
|---|
public WordList getWordList()
WordListpublic boolean search(java.lang.String word)
search in interface Dictionaryword - String to search for
boolean - whether word was found
public static void main(java.lang.String[] args)
throws java.lang.Exception
WordListDictionary.
args - String[]
java.lang.Exception - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||