File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLyBird 1.1.3 find() interface method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird 1.1.3 find() interface method" Watch "URLyBird 1.1.3 find() interface method" New topic
Author

URLyBird 1.1.3 find() interface method

Carlos Morillo
Ranch Hand

Joined: Jun 06, 2009
Posts: 221

Hello Everybody,


I have in my assignment DB interface:





I have read several postings here in this forum where clearly there is a need to distinguish between the records matching
the criteria String[] in the find() interface method and in the GUI where:

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.


I just want to double check and clarify my assumptions with the find() interface method.

Is it correct to assume if we have the argument:


to my find() method in my Data class implementing the DB interface, should it return an int[] of record numbers where each record
will have "Sheraton" as Hotel name and "New York" as the Hotel Location and "4" as the maximum occupancy of the room?

Or should it return instead an int[] of record numbers where you have all the "Sheraton" hotel rooms, all the "New York" hotel rooms and all the rooms with "4" as the maximum occupancy?


Thanks in advance for your help,


Carlos.


SCSA, OCA, SCJP 5.0, SCJD http://www.linkedin.com/in/carlosamorillo
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5266
    
  13

Hi Carlos,

On this forum are many, many threads containing discussions about the find-method and how the criteria should be used.

I OR'ed the different criteria (so in your example: return an int[] of recNo where you have all the "Sheraton" hotel rooms, all the "New York" hotel rooms and all the rooms with "4" as the maximum occupancy). So if 1 criterium matched, the recNo was added to the array that is returned.
In my business service the records returned by the find method are filtered, so only exact matches (which are AND'ed) will be shown in the GUI.

But as I said this is my approach, other people have AND'ed the different criteria in the find-method.

Kind regards,
Roel


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Carlos Morillo
Ranch Hand

Joined: Jun 06, 2009
Posts: 221

Hi Roel,


I've been doing a lot of search lately here and I did find only the distinction between the find() interface method and what should be done in the GUI
that are 2 totally separate things.

For the latter I did see a lot about AND and OR, but not much about the find() interface method itself.


Thanks,


Carlos.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5266
    
  13

What's exactly the problem you are facing

Almost al the threads you'll find about the find-method are dealing with AND'ing or OR'ing the different values of the criteria-array. The find-method returns records which "starts with" the according value, but your GUI is expecting exact matches.

Kind regards,
Roel
Carlos Morillo
Ranch Hand

Joined: Jun 06, 2009
Posts: 221

Hi Roel,

At the moment I am good and my find() method is already implemented.
You have already been very helpful.


Best Regards,

Carlos.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URLyBird 1.1.3 find() interface method