Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

find method in B&S  RSS feed

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Karnani,

In my assignment i use only name and location criteria, or id of record as criteria, i assume this as satisfied requirements.
 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!