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 as much as possible of its structure with other copies to minimize memory consumption.

The library includes a singly linked (cons/cddr style) list/stack, an integer trie based indexed list, a 2-3 tree based random access indexed list, a 2-3 tree based map, a hash trie based map, and hash and tree based sets, and sparse arrays. 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 trie classes are optimized for performance and can be used alongside java.util Collections when immutability is needed for safe data sharing.

Features

  • Persistent/Immutable Maps
  • Persistent/Immutable Lists
  • Persistent/Immutable Sets
  • Persistent/Immutable Sparse Arrays
  • java.util Collection interoperability

Project Activity

See All Activity >

Categories

Libraries

License

BSD License

Follow Immutable Collections for Java

Immutable Collections for Java Web Site

nel_h2
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Immutable Collections for Java!

Additional Project Details

Intended Audience

Developers

Programming Language

Java

Related Categories

Java Libraries

Registered

2013-09-24