This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes Sublisting large list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Sublisting large list" Watch "Sublisting large list" New topic
Author

Sublisting large list

chets patel
Ranch Hand

Joined: Apr 27, 2010
Posts: 77

Hi All,
I have a list of having more than 2000 records. I want to get sublist of the same. But it is very slow. Is there any other way I can get the sublist of the large list.
Please help.

Thanks in advance.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2266
    
    3

Please TellTheDetails. Is this list ordered already? What are these "records"? Are these objects too complex? What is the filter for this sublist?


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
2000 is not a large list. It should take a few μs to get a sublist.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19725
    
  20

Please show us how you create this sub list. If that's slow then perhaps you're doing it in a less efficient way.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

chets patel wrote:Is there any other way I can get the sublist of the large list.


There are many ways. If the way you're using is to slow, then you should use a different way.
 
 
subject: Sublisting large list