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
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.
Java Collection framework provides many interfaces (Set, List, Queue, Deque) and classes (ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet, TreeSet).
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.
All the collection classes are present in java. util and java. util. concurrent package.
Lambdaj is awesome.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With