Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

criteriaFind size  RSS feed

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
I completed my criteriaFind()method some time ago, and it seems to work ok. However on reviewing it now my approach seems very long and rather tedious. My approach has 100 lines approx without comments.
Anybody let me know roughly what number of lines was in their method(without comments).
Also i include in my method an adjustment to search tokens to change values where value submitted in criteria string has only 1 word but the column name has 2 -eg "Origin airport". However this seems very specific to FBN and would probably be undesirable in Data class however Specification seems to suggest this is what is required. Any thoughts.
Thanking you all.
tom
[ March 09, 2002: Message edited by: tom mcmorrow ]
 
ranger
Posts: 17344
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Also i include in my method an adjustment to search tokens to change values where value submitted in criteria string has only 1 word but the column name has 2 -eg "Origin airport".


You only need two tokenizers, on for a comman and one for an equals sign. The field name having two wrods in it is meaningless, and doesn't need any extra code.
As far as the size of my code. The actual criteriaFind method in my Data class was about 10 lines. However it did use two private methods, one to Make a HashSet of the values, and one that checks a record to that Hashset. So maybe 30 lines total.
Mark
 
My pie came with a little toothpic holding up this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!