wood burning stoves 2.0*
The moose likes Java in General and the fly likes Filtering a list of Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Filtering a list of Beans" Watch "Filtering a list of Beans" New topic
Author

Filtering a list of Beans

Nick Delauney
Ranch Hand

Joined: Sep 28, 2002
Posts: 43
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,


N.D:"Anything worth having, takes time to get"
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
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.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
Don't get me started about those stupid light bulbs.
 
subject: Filtering a list of Beans
 
Similar Threads
problem with spring security
Logout servlet problem with back button
sort an arraylist of custom objects
LazyInitializationException [spring + struts2]
Running sample Beehive NetUI Tutorial using Tomcat