Hi Travis,
My approach is kind of different from yours.
1. Parse criteria using StringTokenizer for ",". I also watch out for the scenario where there is only one search pair, such as "Carrie=ANY" (I try to make it as generic as possible).
2. Parse tokens for "=".
3. Find out the field position for each value pair. For example, Carrie is in 3rd position (description[3] is Carrie).
4. I populate a HashMap with key value pairs (key as the field position, and value as the field value to match).
All the above steps are handled in a separate utility class.
5. Read a record.
6. Loop through the previous populated HashMap. Access only those record fields, which are key value in the map. Compare value and add valid records to a list.
7. Turn the list into an Array and return it.
In this case, I don't need to go through every single field in each record. After all, I just need to compare values for the fields specified in the criteria.
Hope this will help.
-Faye