This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes find method in B&S Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "find method in B&S " Watch "find method in B&S " New topic
Author

find method in B&S

pramod karnani
Ranch Hand

Joined: May 22, 2007
Posts: 88

Sun specified find method

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



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.

in my criteria array has 3 elements.

criteria[0]= name
criteria[1]= location
criteria[2]= either (name and location) or (name or location)

is it okay ?
should I provide some more search criteria ?

let me know.
Regards
PRAMOD KARNANI

Carlos Lacerda
Ranch Hand

Joined: Apr 09, 2003
Posts: 34
Hi Karnani,

In my assignment i use only name and location criteria, or id of record as criteria, i assume this as satisfied requirements.


Carlos Lacerda, Brasil
[SCJP 1.4-5.0] [SCJD] [SCWCD] [SCEA] [OCA-OAS 10g]
mohamed sulibi
Ranch Hand

Joined: Sep 04, 2005
Posts: 169
hi pramod KARNANI;

there are two requirement for your search implementation one of them find in the java doc provided and another in the requirement as client side searches,
read the java doc properly you see that : "Field n in the database file is described by
// criteria[n]." so the criteria size is as the fields size.

you must implements the search method as the java doc say. then think on the client side searches requirements.


Best Regards.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: find method in B&S
 
Similar Threads
Search
NX: Contactor: Query on Search method
Do we need to filter the search result data?
URLyBird 1.3.2 : find method ambiguos
URLyBird: What is "exactly match" in URLyBird?