Can i query a List? Java

Posted by Nitesh Panchal on Stack Overflow See other posts from Stack Overflow or by Nitesh Panchal
Published on 2010-05-17T11:14:46Z Indexed on 2010/05/17 11:20 UTC
Read the original article Hit count: 123

Filed under:

Hello,

Say i have

List<SomeObject> objList = new ArrayList<SomeObject>();

If someObject contains a field named id. Can we find it through some query like

objList.filter('id=2');

wihout looping through the list? If not, then why? This can be so useful method and used as an alternative to write tedious for loop?

Just a question that came to my mind so i thought i must clear it here :)

Thanks in advance :)

© Stack Overflow or respective owner

Related posts about java