Purpose:
WordFinder
is a class that can be used to
find the word (in a list of words) that begins with a
given "prefix".
GUI | Graphical User Interface |
About the System:
WordFinder
is being developed for use in a
GUI component for text entry that performs "auto completion".
Some Contextual Information: The GUI component will, ultimately, be used to allow users to "type" street names more easily.
and can be used in conjuction with the following driver:
CompletingFieldDriver ( Source Code )
A protoype word list has also been developed tha contains all of the street names in Virginia. It is available at:
The system must satisfy the following operational requirements:
OR-1 The class must have an explicit value constructor with the following signature:
public WordFinder(String fn)
where fn
is the name of the file containing the
word list.
OR-2 The class must have a method with the following signature:
public String find(String prefix)
where prefix
is the "starting string" to search for and
the return value is any String
in the list that starts with
prefix
(or null
if there is no such
String
).
OR-3
The find()
method must have an logarithmic
time efficiency [i.e., must be where
is the number of words in the list].
Copyright 2007