A Guide to ConcurrentMap 1. Overview Maps are naturally one of the most widely style of Java collection. And, importantly, HashMap is not a thread-safe implementation, while Hashtable does provide thread-safety by synchronizing operations. Even though Hashtable is thread safe, it is not very efficient. Another fully synchronized Map, Collections.synchronizedMap,… Continue Reading java-concurrent-map

An Introduction to Synchronized Java Collections 1. Overview The collections framework is a key component of Java. It provides an extensive number of interfaces and implementations, which allows us to create and manipulate different types of collections in a straightforward manner. Although using plain unsynchronized collections is simple overall, it… Continue Reading java-synchronized-collections

Guide to the ConcurrentSkipListMap 1. Overview In this quick article, we’ll be looking at the ConcurrentSkipListMap class from the java.util.concurrent package. This construct allows us to create thread-safe logic in a lock-free way. It’s ideal for problems when we want to make an immutable snapshot of the data while other… Continue Reading java-concurrent-skip-list-map

Guide to Apache Commons MultiValuedMap 1. Overview In this quick tutorial, we’ll have a look at the MultiValuedMap interface provided in the Apache Commons Collections library.  MultiValuedMap provides a simple API for mapping each key to a collection of values in Java. It’s the successor to org.apache.commons.collections4.MultiMap, which was deprecated in Commons Collection 4.1. 2. Maven… Continue Reading apache-commons-multi-valued-map

Combining Different Types of Collections in Java 1. Introduction In this quick tutorial, we’ll explore different ways of combining collections in Java. We’ll explore various approaches using Java and external frameworks like Guava, Apache, etc. For the introduction to Collections, have a look at this series here. 2. External Libraries… Continue Reading java-combine-collections