Immutable Collections for Java is a library providing immutable/persistent collection classes for Java. While collections are immutable, they provide methods for adding and removing values by creating new modified copies of themselves. Each copy shares almost all of its structure with other copies, to minimize memory consumption. The library includes a singly-linked (cons/cddr style) list/stack, an integer tree-based indexed list, a 2-3 tree-based random access indexed list, a 2-3 tree-based map, a hash tree-based map, and hash- and tree-based sets. All collections provide immutable Cursor as well as standard Iterator classes for looping through all elements. A utility class provides functional style algorithmic processing of Cursors, including foldLeft, foldRight, collect, select, and reject. The 2-3 tree and integer tree classes are optimized for performance and can be used alongside java.util Collections when immutability is needed for safe data sharing.
|Tags||Java collections immutable functional|
|Operating Systems||any Java|
Release Notes: This release improves performance and reduces the memory footprint of hash maps and sets. It also allows use of Cursors in foreach loops.
Release Notes: This release provides significant performance enhancements in hash maps and insert order maps. It also adds a new JImmutableArray interface and implementation, providing memory-efficient sparse arrays.
Release Notes: Adds a JImmutableMap class whose Cursor iterates over elements in the order that they were originally inserted into the map. This is similar to Java's LinkedHashMap. Assign and delete are slower on these maps, but iteration is similar to a sorted map. Adds JImmutableListMap. These are maps whose values are JImmutableLists. They allow storage of more than one value per key. Other variations include sortedListMap() and insertOrderListMap(). Curry has more factory methods for currying function objects. Also adds new static helper methods to Curry, Tuple*, and Functions classes.
Release Notes: Adds new Tuple and Func classes. Has some performance optimizations in the construction of JImmutableLists from other collections.