Eclipse Collections provides additional collection types not found in the JDK.
The JDK may not have all of the data structures you need to build your Java applications. In part 1 of this blog series, I will cover several data structures that you will not find in the JDK today, but that are available in Eclipse Collections.
Intervalis a range of
Integervalues with a
Intervalmay be forward or reverse depending on whether the
fromis less than…
Learn how to filter specific types in a mixed Java collection
Sometimes you have a mixed Collection in Java. A simple example is having a
List<Number> , where the list may contain
Double instances. How can you easily filter out the
List<Integer> or the
List<Double>? I will demonstrate how to do this with classic Java, using Pattern matching for instanceof in Java 16, and using two different approaches with Eclipse Collections. I have also added a preview solution using JDK 17 EA and Pattern Matching in Switch.
This is one way to solve the problem using…
A poem about time and change.
This is a very short poem I wrote in 1988 that was published in my high school’s art and literary magazine. I hope you enjoy the poem, and my selection of pictures to go with it.
I love this world
Yet, I know
Love is never enough,
to keep anything,
Iterating over Lists in Java with indices using external and internal iterators
In Java, there are a few ways to to iterate over a
List with indices. I will cover a few of the most common external iteration approaches, and how they can be combined with providing an index. I will explain how to use the
RandomAccess interface to safely iterate over the
This is the most basic form of collection iteration that works with any
Collection (prior to Java 5), and any
Iterable type in Java (since Java 5).
List<Integer> list = Lists.mutable.with(1, 2, 3);
int index =…
A Katalogue of Code Katas recorded in a Code Kata
A hands-on programming exercise which helps hone your skills through practice.
Many of us learn best by doing. We build confidence and expertise through continual practice. We also learn by teaching. A Code Kata may help you build proficiency by implementing algorithms in various languages to solve specific problems. A Code Kata may also help you practice leveraging the APIs provided in a library, like Eclipse Collections or Java Streams. Sharing code katas you develop with a community of developers will help you learn even more.
Using Java and Kotlin with Eclipse Collections to solve the Donut Kata
To celebrate the 10 year anniversary of the Kotlin programming language, I thought I would share the solutions to the Donut Code Kata using both Java 16 and Kotlin 1.5.0 with Eclipse Collections 11.0.0.M2. The purpose of the Donut Kata is to help familiarize developers with lesser-known methods in the Eclipse Collections API. Eclipse Collections is a Java library, so it works well in both Java and Kotlin.
The domain of the Donut Kata is a Donut Shop. You make donuts, take orders for donuts, and deliver donuts…
Learning a little Python using the Eclipse Collections Pet Kata
I’ve programmed in more than twenty programming languages over the past four decades. I’ve coded in Java for 20+ years, and am the creator of a Java collections framework called Eclipse Collections. I have never tried to learn Python before. That is, until now.
I am a Java Champion, and regularly teach and advocate for the Java programming language. My learning Python might seem a bit odd to some. In fact, some of my friends started pinging me on Twitter after I posted several tweets about me solving the Pet…
Everything I know about software development in a single page of quotes.
At the end of 2003, I accepted an opportunity to go on an extended business trip with my family to England. We moved to London in January of 2004, and returned back to the states at the end of the same year. Before I left, I decided I wanted to distill everything I knew about software development down to a set of memorable quotes. I used to read a lot of books. Most of the books I read were technical, but some were about leadership and project management…
Out of hundreds of possibilities, these are some of my favorite methods available on the Eclipse Collections API.
Eclipse Collections has a very feature rich API. If you ever wished a Java Collection could do something more “collection-like”, Eclipse Collections probably has a method that does it. The following blog has a mind-map of the methods available on the Eclipse Collections API.
You can try and debug the results above in your mind, but I thought it would be more helpful if I just showed you the results inline using IntelliJ.
A poem about limiting yourself.
This is a poem I wrote in 1988 that was published in my high school’s art and literary magazine. I hope you enjoy the poem, and my selection of pictures to go with it.
Watch out little fly,
Don’t get caught,
You’re in danger, run away quick!
Don’t you understand,
Spider’s web means spider,
Spider means death.
Oh well, if you must follow every other fly’s mistake,
Learn for yourself.
You’re about to join an exclusive group,
And once you’re in the web,
You kill off all other possibilities.
To put it simply,