I am facing a problem with the crtiteriaFind method. The first part is easy, using a String Tokeniser. The second part is a little confusing.....below is the my logic
String  values =dinfo.getValues();
if(fieldName.equals(finfo[p].getName()) && (fieldValue.equals(value[p])))
/*My problem lies here, did you guys save the datainfo object here and then do a second search for all the second criteria*/
*I am saying the second criteria cos if the first one is carrier=prompt air and thats what the above code does. there is still the second left which is origin=lax...etc how did u guys implement that
}//end of for record count
any ideas?? i believe I am not on the wrong path..
Originally posted by Prakash Krishnamurthy:
Got it! In The first search I saved all the record numbers that matched the first search criteria and the second time I searched on those record numbers which I got from the first and returned it to a array....
Not exactly what I proposed. In your algorith you are reading records more than once. In my approach you only look at the record once. Try using a flag/boolean that is set to true, meaning match, then go through the criteria on that one record, and the moment it doesn't match set the boolean to false, then when that criteria loop is finished check the flag if true put that record in the matched collection, if false go to the next record.
Originally posted by Chris Chang:
Is it possible to use Regular Expression in JDK1.4 for searching ?
Yes you can, if you want. I tried to use them in the Beta exam, but ended up thinking that the other way described above was easier to implement, write, and understand. But thats not saying that I would never use Regular Expressions. On the contrary, I love regular expressions, they handle so many different tasks that would be near impossible any other way.