This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm currently banging out the search method for the Data class. Here's what I'm doing: I have a vector for search results that match the query(to later be converted into a array of DataInfo objects) Extracting the Values - no problem, used string tokenizer and substring to get the field name and value then put them in an array of strings. searching - for loop with getRecord(i). retreives array of strings and fieldInfo from the DataInfo to two separate arrays, respectively.(will use getName() on fieldInfos later) My problem now lies in acutally comparing the Strings. Coding this will be easy(if a bit tedious), but is there a better way to due this than having a kazillion nested for loops? Feel free to correct me on the above also. Thanks
Adam Roberts - SCJP2, SCJD<br />insert witty something here
Hi Adam, I have a post on the same subject. I pulled mine off with 3 loops and about 50 lines of code. Instead of matching every field name, I keyed on the index of each field and put the criteria value into a HashMap thereby eliminating one of the loops. Anyway here's the post: criteriaFind Hope this helps Michael Morris SCJP2 [ March 26, 2002: Message edited by: Michael Morris ]
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher