aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Assumption for  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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Assumption for  find method in B&S" Watch "Assumption for  find method in B&S" New topic
Author

Assumption for find method in B&S

pramod karnani
Ranch Hand

Joined: May 22, 2007
Posts: 88

Sun spec defines find method like this:

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

number of field in each record has 6 elements
so criteria[] must have 6 elements ?
like this

criteria[0]=name
criteria[1]=location
criteria[2]=specialties
criteria[3]=size
criteria[4]=rate
criteria[5]=owner


since it is clearly written in spec "A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. "

Client side search

criteria[0]=name
criteria[1]=location
either criteria[2]= | or criteria[2]= &



My assumption for criteria array and find method okay ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Assumption for find method in B&S