SharedCollections

com.github.douglasorr.shared - a small collection of immutable data structures for use in plain old Java code.

Getting started

We think Maven-based build tools are the best way to get using our library:

(see tabs for specific build tools --^)
groupId: com.github.douglasorr
artifactId: shared
version: latest.version
<!-- This goes in pom.xml -- <project> -- <dependencies> -->
<dependency>
    <groupId>com.github.douglasorr</groupId>
    <artifactId>shared</artifactId>
    <version>latest.version</version>
</dependency>
<!-- This goes in ivy.xml -- <dependencies> -->
<dependency org="com.github.douglasorr" name="shared" rev="latest.version" />
// This goes in build.gradle -- dependencies {...}
compile 'com.github.douglasorr:shared:latest.version'

Then, once your build tool or IDE has downloaded the library you need, you should be ready to start using shared immutable collections...

import com.github.douglasorr.shared.HashTrieMap;
import com.github.douglasorr.shared.SharedMap;

public class App {
    public static void main(String[] args) {
        SharedMap<String, Integer> one = HashTrieMap.singleton("one", 1);
        SharedMap<String, Integer> another = one.with("two", 2).with("three", 3).without("one");
        System.out.println(one);       //= {"one": 1}
        System.out.println(another);   //= {"two": 2, "three": 3}
    }
};

Links

Version 0.1.0

Map.put performance