Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any good libraries of functions to use with collections in Java, such as [closed]

Are there any good libraries of functions to use with collections in Java. I'm thinking along the lines of implementations of partition, take, drop, takeWhile, dropWhile, map, filter, reduce...? I can write them myself, but it feels like re-inventing the wheel.

Thanks, Alex

like image 776
Alex Baranosky Avatar asked Aug 30 '10 03:08

Alex Baranosky


People also ask

What is the difference between Java collection and Java collections?

Collection is called interface in java whereas Collections is called a utility class in java and both of them can be found in java. util. package. Collection is used to represent a single unit with a group of individual objects whereas collections is used to operate on collection with several utility methods.

Can you explain me few data structure name which is using Java Collection API?

Java Collection framework provides many interfaces (Set, List, Queue, Deque) and classes (ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet, TreeSet).

Which collection is best for searching in java?

If you need fast access to elements using index, ArrayList should be choice. If you need fast access to elements using a key, use HashMap.

Which package contains all the collection classes?

All the collection classes are present in java. util and java. util. concurrent package.


2 Answers

Lambdaj is awesome.

like image 86
pondermatic Avatar answered Sep 28 '22 02:09

pondermatic


Google Collections (Guava) is great! Collections2 and Iterables are utility classes worth looking at. They both have a filter and transform (like map) method, among many other things.

like image 35
Mark Peters Avatar answered Sep 28 '22 02:09

Mark Peters