Class LongHashSet

  • All Implemented Interfaces:
    Serializable, Iterable<Long>, Collection<Long>, Set<Long>

    public class LongHashSet
    extends AbstractSet<Long>
    implements Serializable
    A hash set implementation of Set<Long> that uses open addressing values. To minimize the memory footprint, this class uses open addressing rather than chaining. Collisions are resolved using linear probing. Deletions implement compaction, so cost of remove can approach O(N) for full maps, which makes a small loadFactor recommended. The implementation is based on Agrona IntHashSet but uses long primitive keys and a different MISSING_VALUE to account for Long.hashCode() being 0 for -1.
    See Also:
    Serialized Form