Class ImmutableSet<T>

  • Type Parameters:
    T - the type of elements
    All Implemented Interfaces:
    Iterable<T>, Collection<T>, Set<T>
    Direct Known Subclasses:
    ImmutableHashSet

    public abstract class ImmutableSet<T>
    extends AbstractSet<T>
    Weld's immutable set implementation. Instances returned from methods of this class may use different strategies to achieve good performance / memory consumption balance.

    These strategies include:

    • A single shared Set implementation instance representing an empty list
    • An optimized implementation for holding one, two or three references.
    • An immutable Set implementation based on hashing

    Author:
    Jozef Hartinger