Class ImmutableSet<T>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<T>
org.jboss.weld.util.collections.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