These are the instructions in my project.
User Interface instructions
It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.
DDBMain Interface
/ Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)
public int [] find(
String [] criteria)
throws RecordNotFoundException;
My understanding from the above is, if i pass a string "Fred" the query should return records that has name starting with Fred or Freddy.
for example if the data has three records
First Name
---------------
Fred Campbell
Freddy Jones
Fredricks Doe
I would return the three records as they all start with Fred.
OR
Let my interface return three records. but my support method which calls the find(String[] criteria)method should filter the other two records(Freddy,Fredricks). This way both the requirements are satisfied.
which way is right?
Please correct me if i am not understanding it properly.
----------------------
John
[ April 10, 2008: Message edited by: John Mattman ]
[ April 10, 2008: Message edited by: John Mattman ]