Releases: brianburton/java-immutable-collections
Version 2.2.0
This release provides the following major improvements.
- Sorted map,
JImmutables.sortedMap()
, implementation changed to use a B-Tree instead of a 2-3 Tree. The B-Tree implementation offers better performance and simpler code. - Hash map,
JImmutables.map()
, implementation changed to use a simpler HAMT implementation that stores values inside interior nodes as well as in leaf nodes. The new implementation offers significant performance improvements and some memory savings. - Sparse array,
JImmutables.array()
, implementation simplified by removing the extra methods previously used by hash maps. - All collections now implement Serializable interface.
- All collections now provide methods to create Stream Collector implementations that can be used to construct collections directly from a Stream.
More information about the new maps is available in a blog post.
<dependency>
<groupId>org.javimmutable</groupId>
<artifactId>javimmutable-collections</artifactId>
<version>2.2.0</version>
</dependency>
Version 2.1.0
This version focuses on usability improvements in the API.
New features in this release:
- Adds new lambda friendly methods to IterableStreamable (base interface for all collections as well as views returned by methods such as
keys()
,entries()
, andvalues()
.count()
: Returns total number of elements.count(p)
: Returns total number of elements for which Predicatep
returns true.allMatch(p)
: Returns true if Predicatep
returns true for all elements.anyMatch(p)
: Returns true if Predicatep
returns true for any element.first(p)
: Returns Holder containing first element for which Predicatep
returns true, otherwise returns empty Holder.collect(c)
: Adds all elements to Insertablec
.collect(n,c): Adds first
nelements to Insertable
c`.collect(c,p)
: Adds all elements for which Predicatep
returns true to Insertablec
.collect(n,c,p)
: Adds firstn
elements for which Predicatep
returns true to Insertablec
.transform(c,t)
: Adds result of calling Func1t
for every element to Insertablec
.transform(n,c,t)
: Adds result of calling Func1t
for firstn
elements to Insertablec
.transformSome(c,t)
: Same astransform(c,t)
exceptt
returns a Holder and only the contents of non-empty Holders are added toc
.transformSome(n,c,t)
: Same astransform(n,c,t)
exceptt
returns a Holder and only the contents of non-empty Holders are added toc
.partition(m,u,p)
: Adds every element to eitherm
oru
. All elements for whichp
returns true are added tom
and all others are added tou
.reduce(f)
: Callsf
for every element and returns final result.
- Fixes
insertAll()
methods that previously returnedInsertable
instead of the class the method belonged to. - Adds more
insertAll()
variants toInsertable
. - Refactors multi-value methods like
insertAll()
,deleteAll()
, etc to useIterable
instead ofCursorable
. Variants takingCursor
are still provided but the refactoring allows the library to default to using lower overheadIterators
instead. - Adds
select()
andreject()
methods to JImmutableSet working the same way as those on JImmutableList.
Version 2.0.0
This release adds a number of new features and improvements on existing ones.
- Adds
stream()
andparallelStream()
methods to all collections to create Java 8 streams. - Adds JImmutableCollectors methods to allow immutable collections to be constructed using streams.
- Adds
keys()
andvalues()
methods to maps providing access to fast streams and iterators. - Adds
select()
andreject()
methods to JImmutableList to simplify taking subsets of lists without creating a stream. - Adds
reduce()
method to all collections to simplify scanning contents of collections to compute a value without creating a stream. - Improves the efficiency of iterators for all collections.
- Adds support for creating streams from Cursors.
This is the first release to require use of Java 8 or higher to use the library. The 1.9.1 release is still available for anyone using older versions of Java. Artifacts have been pushed to maven central.
<dependency>
<groupId>org.javimmutable</groupId>
<artifactId>javimmutable-collections</artifactId>
<version>2.0.0</version>
</dependency>
1.9.1
Version 1.9.1
It's been a long time coming but the 1.9 release is finally here! This is a significant release with several new collection types and performance enhancements.
New JImmutableRandomAccessList implementation
Previous releases used a 2-3 tree implementation of JImmutableRandomAccessList that performed adequately but was much slower than the hash trie based JImmutableList implementation. In 1.9 the JImmutableRandomAccessList has been re-implemented as a B-Tree. The B-Tree decreases the average depth of the tree and has more than 2x the performance of the 2-3 tree. In fact benchmarks using large lists (more than 20k values in the list) out performed the standard java.util.ArrayList for sequences of inserts and deletes in random positions within the list. The hash trie is still faster but the performance gap is much smaller than before.
JImmutableMultiset
This new collection provides functionality similar to Guava's Multiset but in an immutable form. Methods in the interface allow the multiset to interact with normal sets in rational ways while also exposing the new capabilities. Hashed, sorted, and in-order versions are available. (shout out to Angela Burton)
JImmutableSetMap
This much needed new collection is similar to JImmutableListMap but values for key are JImmutableSets instead of JImmutableLists. Hashed, sorted, and in-order versions are available. Note that all of the underlying sets are hashed, the sorted and in-order variations affect how the keys are handled, not the sets themselves. (another shout out to Angela)
Expanded Stress Test Tool
The new and improved stress test tool, used for pre-release endurance testing, tests more collection types and covers more methods of all collections than the old one. Greatly expands the pre-release test coverage for the library. (Angela again)
Issue Resolution
#4 Added extra type declarations to work around eclipse compiler bug.
1.9-beta-3
Beta 3 Release for 1.9
It's been a long time coming but the 1.9 release is finally near. At this point the new code appears to be solid but releasing as a beta first to allow others to try it out in advance. This is a significant release with several new collection types and performance enhancements.
New JImmutableRandomAccessList implementation
Previous releases used a 2-3 tree implementation of JImmutableRandomAccessList that performed adequately but was much slower than the hash trie based JImmutableList implementation. In 1.9 the JImmutableRandomAccessList has been re-implemented as a B-Tree. The B-Tree decreases the average depth of the tree and has more than 2x the performance of the 2-3 tree. In fact benchmarks using large lists (more than 20k values in the list) out performed the standard java.util.ArrayList for sequences of inserts and deletes in random positions within the list. The hash trie is still faster but the performance gap is much smaller than before.
JImmutableMultiset
This new collection provides functionality similar to Guava's Multiset but in an immutable form. Methods in the interface allow the multiset to interact with normal sets in rational ways while also exposing the new capabilities. Hashed, sorted, and in-order versions are available. (shout out to Angela Burton)
JImmutableSetMap
This much needed new collection is similar to JImmutableListMap but values for key are JImmutableSets instead of JImmutableLists. Hashed, sorted, and in-order versions are available. (another shout out to Angela)
Expanded Stress Test Tool
The new and improved stress test tool, used for pre-release endurance testing, tests more collection types and covers more methods of all collections than the old one. Greatly expands the pre-release test coverage for the library. (Angela again)
Issue Resolution
#4 Added extra type declarations to work around eclipse compiler bug.