aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes a question about requirement, findByCriteria Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "a question about requirement, findByCriteria" Watch "a question about requirement, findByCriteria" New topic
Author

a question about requirement, findByCriteria

Peter Aarum
Ranch Hand

Joined: Jan 14, 2010
Posts: 44
Howdy folks!

Does the sun provided interface comment:
// 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 long[] findByCriteria(String[] criteria);


contradict with this line in instructions.html? :
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.

I think so, you?

BR
Peter

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5543
    
  13

Peter,

No, it doesn't at all! Just other requirements for algorithm used in Data class and in your GUI. You will have to implement some filtering to only show the exact matches in your JTable.
If you use the search engine you 'll find tons of threads on this issue, because besides locking it is one of the requirements where people have doubts/questions about.

Kind regards,
Roel


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Peter Aarum
Ranch Hand

Joined: Jan 14, 2010
Posts: 44
Ah I suspected something like this. I have indeed made some searches regarding this. Didnt find anything right away and I was lazy

Thanks very much for the fast reply Roel

BR
Peter
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: a question about requirement, findByCriteria