Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Filtering a list of Beans

 
Nick Delauney
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to figure out a way to generically filter a List of beans (assume list contains objects of the same type). I am thinking that I need to create a filter string and have the list parse and match the objects in the list against the filter.

Has anyone done this before, or can help in anyway?

Thanks,
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Describe what you mean by filter string or show us what you've tried. If you want to always filter all widgets with price < 10.00 that's pretty easy. If you want the user to enter expressions so the string looks like "price < 10.00" or "quantity > 5" things get a bit trickier.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic