Skip to content

Releases: brianburton/java-immutable-collections

Version 2.2.0

23 Dec 06:03
Compare
Choose a tag to compare

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

11 Nov 23:00
Compare
Choose a tag to compare

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(), and values().
    • count(): Returns total number of elements.
    • count(p): Returns total number of elements for which Predicate p returns true.
    • allMatch(p): Returns true if Predicate p returns true for all elements.
    • anyMatch(p): Returns true if Predicate p returns true for any element.
    • first(p): Returns Holder containing first element for which Predicate p returns true, otherwise returns empty Holder.
    • collect(c): Adds all elements to Insertable c.
    • collect(n,c): Adds first nelements to Insertablec`.
    • collect(c,p): Adds all elements for which Predicate p returns true to Insertable c.
    • collect(n,c,p): Adds first n elements for which Predicate p returns true to Insertable c.
    • transform(c,t): Adds result of calling Func1 t for every element to Insertable c.
    • transform(n,c,t): Adds result of calling Func1 t for first n elements to Insertable c.
    • transformSome(c,t): Same as transform(c,t) except t returns a Holder and only the contents of non-empty Holders are added to c.
    • transformSome(n,c,t): Same as transform(n,c,t) except t returns a Holder and only the contents of non-empty Holders are added to c.
    • partition(m,u,p): Adds every element to either m or u. All elements for which p returns true are added to m and all others are added to u.
    • reduce(f): Calls f for every element and returns final result.
  • Fixes insertAll() methods that previously returned Insertable instead of the class the method belonged to.
  • Adds more insertAll() variants to Insertable.
  • Refactors multi-value methods like insertAll(), deleteAll(), etc to use Iterable instead of Cursorable. Variants taking Cursor are still provided but the refactoring allows the library to default to using lower overhead Iterators instead.
  • Adds select() and reject() methods to JImmutableSet working the same way as those on JImmutableList.

Version 2.0.0

04 Nov 23:55
Compare
Choose a tag to compare

This release adds a number of new features and improvements on existing ones.

  • Adds stream() and parallelStream() methods to all collections to create Java 8 streams.
  • Adds JImmutableCollectors methods to allow immutable collections to be constructed using streams.
  • Adds keys() and values() methods to maps providing access to fast streams and iterators.
  • Adds select() and reject() 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

14 Oct 14:46
Compare
Choose a tag to compare

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.

Developer's Notes

1.9-beta-3

07 Oct 13:32
Compare
Choose a tag to compare
1.9-beta-3 Pre-release
Pre-release

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.

v1.8

13 May 17:18
Compare
Choose a tag to compare
[maven-release-plugin]  copy for tag v1.8

v1.7

13 May 17:24
Compare
Choose a tag to compare
[maven-release-plugin]  copy for tag v1.7

v1.6

13 May 17:25
Compare
Choose a tag to compare
[maven-release-plugin]  copy for tag v1.6

v1.5

13 May 17:25
Compare
Choose a tag to compare
[maven-release-plugin]  copy for tag v1.5

v1.4

13 May 17:27
Compare
Choose a tag to compare
[maven-release-plugin]  copy for tag v1.4