Java Developer since 2011, Pittsburgh JUG leader, Committer at Eclipse Collections Java Library.
Continuing from Part 1, in the Eclipse Collections 11.0 release, we will have the following Set operations union, intersect, difference, symmetricDifference, isSubsetOf, isProperSubsetOf, cartesianProduct on primitive collections.
These APIs are already available on Sets on the object side, but my goal was to implement these methods for Sets supporting primitive types namely IntSet, LongSet, ShortSet, DoubleSet, FloatSet, CharSet, BooleanSet, ByteSet. Additionally, the above operations will be available in both mutable and immutable interfaces.Sirisha Pratha
Eclipse Collections has a rich assortment of data structures, and one of them is a Set.
Recently, I worked on an issue to implement union, intersect, and difference operations in sets for primitive types.
The sections below cover each operation’s objective, design considerations, and code implementation.
The last section covers the takeaways.Sirisha Pratha
Ever since Java announced their 6-month release cycle, there is excitement around exploring new features and even more so with preview features.
Now, what is a record? It is a new variety of type declaration. It is also a sub-type of class. A common type of class, as we all know, is the data-carrier class. They are classes that have some fields and their corresponding getters and setters. They usually have little to no logic.
Records help provide a way to succinctly describe the intent of these data-carrier classes. A little less conversation, a little more action.Sirisha Pratha