• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird findByCriteria

 
Mike Ngo
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
// 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 long[] findByCriteria(String[] criteria);


Does the search has to be exact? For ex, my GUI allows the CSR to specify max. occupancy for the room. If the selected max. occupancy is 2, Can I return all the rooms with max occupancy of 2 OR higher? Or only rooms with
max occupancy of 2?
 
Kiev Gama
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check your requirements in the instructions.html regarding the search.
What criteria has to be used?

Your findByCriteria API method says " any field value that begins with criteria[n]", but your GUI MAY (or may not) say EXACT criteria.

Write down what you took in consideration on your choices file that has to be delivered along with the code.

If your requirements file really include the occupancy field and does not say anything about an exact match, I guess it would be up to you to take a decision and justify it. If it is there and it says exact match, just parse the String criteria to an int and compare it with ==

Regards,

Kiev
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

As far as I know the UI must provide exact matches for the search criteria, that's the user needs, and it is a must option.
You can have a pluggable search criteria, but it must follow the specs - exact matches.

Regards M.
[ November 14, 2006: Message edited by: Mihai Radulescu ]
 
Mike Ngo
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the requirement:

The user interface for this assignment must satisfy the following 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.

This is the api spec:
// 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 long[] findByCriteria(String[] criteria);



so the only requirement is the hotel name and city must match exactly.
I am going to retrieve all the records matching the criteria for hotel name
and city and then filter out the results further for my application.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic