Hi all,
In the interface provided by Sun, the search method is:
public int[] find(String[] criteria 1. Suppose in my GUI I have a search option, with two textfields, one for name and one for location.
As user enters name I can search for name and same for location.
2. But when users enter both 'name' and 'location' how to decide weather to search for 'name and location' or 'name or location' ? (this is first question)
'Name and location' search will result into smaller result compared to 'name or location'
Also another doubt.
The interface comments for this methods are:
// 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".)
Here it says this, which is not in synch with what it says at other place in the
doc. Somewhere in the doc it says:
"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. "
Here it says it should exactly match.
So how you guys are interpreting this one? (this is my second question)
[ August 05, 2003: Message edited by: Jmannu gundawar ]