Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - Is there any alternative, third-party Collections (ArrayList, etc.) libraries?

The story is that I'm now programming for Android.

I found that ArrayList is really slow, especially when used with adapters for listviews, as sorting and searching are required for my project. Is there any alternative library out there?

Thank you so much.

like image 940
Priere Law Avatar asked Nov 30 '22 20:11

Priere Law


2 Answers

As other answers have said, there are some alternative Collection libraries.

However, in core your problem might not be the library but rather your own choice of Collection. Using a different library, will not change this.

In Java, and thus Android, you have a vast array of Collection choices to your disposal, all with different pro's and cons.

This is a way to long story to write up, so unless you write down exactly what you want to do with it, no one can really tell you which choice is best. However, to give you a little start you could take a look at this;

collection tree

like image 150
Stefan de Bruijn Avatar answered Dec 04 '22 11:12

Stefan de Bruijn


Other than Collection framework in standard java API, below two are famous for their rich collection framework.

  • Google Guava Collections
  • Apache Commons Collections
like image 38
PermGenError Avatar answered Dec 04 '22 12:12

PermGenError