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 Serverless Applications with Node.js this week in the NodeJS 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
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

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
 
You may have just won ten million dollars! Or, maybe a tiny ad.
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!