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: What is 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: What is "exactly match" in URLyBird?" Watch "URLyBird: What is "exactly match" in URLyBird?" New topic
Author

URLyBird: What is "exactly match" in URLyBird?

Mellon Sun
Ranch Hand

Joined: Feb 20, 2003
Posts: 126
With the user interface, the instructions 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.

With the DBMain interface, the instructions says:


"Fred" matches "Fred", this is the "exactly match".
"Fred" matches "Freddy", I think this is not "exactly match".
So, I am really confused.
[ January 31, 2006: Message edited by: sun mellon ]

SCJP,SCWCD1.3,SCWCD1.4,SCJD,SCBCD5,SCEA5
chris rebollar
Greenhorn

Joined: Jan 12, 2006
Posts: 7
Hi:

You have to show all the records that exactly match.

One solution proposed in other threads of this forum was to create an intermediate class which filters all the results of "Data find(String[] criteria);" and returns only the records that exactly match.

Hope this helps.
HaoZhe Xu
Ranch Hand

Joined: Nov 03, 2003
Posts: 222
I have an approach that you may consider.

add a method in Data class, it is used as a switch, maybe called setExactlyMatch(boolean e), then your 'find' method should check the flag first.
You can also do it this way, use a compare interface, have two different implementations, one uses exact match, another uses 'rough match', then your setExactlyMatch method should change the 'compare' reference to appropriate instance, so your 'find' method just need to use the compare reference without checking ;-)

Yours Sincerely
Olnex


[url]Olnex.net[/url]
[SCJP 1.2, SCJD, SCWCD]
Mellon Sun
Ranch Hand

Joined: Feb 20, 2003
Posts: 126
Thanks for your replies.

Maybe use a filter to perform "exactly match" and a switch to "roughly match" in the client is good.

Add a method in Data class used as a switch ,it also means all client either use "exactly match" or "roughly match".So I think put the switch in client side is better.

But I choose use a filter only to make things simple.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URLyBird: What is "exactly match" in URLyBird?