• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

interface spec.

 
Yan Zhou
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My B&S spec. says:

// 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)

I personally think this method should run with case-insensitive, since that would be more useful. However, the spec. does not seem to suggest so.

I wonder how you implement your search: case sensitive or insensitive? If case sensitive, how do you make sure that when user searches for "roofing", you also return "Roofing" (otherwise it would be user unfriendly)?

Thanks.
Yan
 
Inuka Vincit
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure about your spec but mine says EXACT MATCH for searches(which means you need to do some magic before you display the search results). There is a string method int compareToIgnoreCase(String str) if you wish to use it as an optional feature. Remember the MUST requirements if you dont have it you will be docked.
[ October 25, 2004: Message edited by: Inuka Vincit ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic