Class ImmutableSet.RegularSetBuilderImpl<E>

  • Enclosing class:
    ImmutableSet<E>

    private static final class ImmutableSet.RegularSetBuilderImpl<E>
    extends ImmutableSet.SetBuilderImpl<E>
    Default implementation of the guts of ImmutableSet.Builder, creating an open-addressed hash table and deduplicating elements as they come, so it only allocates O(max(distinct, expectedCapacity)) rather than O(calls to add).

    This implementation attempts to detect hash flooding, and if it's identified, falls back to JdkBackedSetBuilderImpl.