Package com.jongsoft.lang.collection

A purely functional based set of collection implementations based upon the Collection.

The implementation consists out of the following groups of interfaces:

  • Sequence, a ordered collection type
  • Set, a collection type that ensures uniqueness
  • Map, a map implementation
  • Iterator, a custom iteration implementation

All implementations within this set of collections are immutable. Meaning that all operations on the collections will result into either a new instance or an unchanged one. This leads to implementations similar to the snippet to add values to a Collection.


     // Correct usage of an immutable collection
     Sequence<String> myStrings = API.List("one")
              .add("two")
              .add("three");

     // Incorrect usage of an immutable collection, as the initial collection assigned to myString does not change
     Sequence<String> myStrings = API.List("one");
     myStrings.add("two");
     myStrings.add("three");
 
Since:
0.0.2
Author:
Gerben Jongerius
See Also:
Immutable objects explaind