This page is no longer maintained — Please continue to the home page at

'Singular' collection type

No replies
Jorge Ortiz
Joined: 2008-12-16,
User offline. Last seen 29 weeks 3 days ago.
I've implemented a Singular collection type, for collections of zero or one elements. I've also included an immutable implementation of Singular (SOption) and two mutable implementations (SWeakReference and SSoftReference).

This is part of larger work I'm doing to port Google's CustomConcurrentHashMap to the new collections library. For this, it turns out it's useful to have Option, WeakReference, and SoftReference implement the same interface.

Feedback welcome.


Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland