
com.carrotsearch.hppc.LongScatterSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hppc Show documentation
Show all versions of hppc Show documentation
High Performance Primitive Collections: data structures (maps, sets, lists, stacks, queues) generated for combinations of object and primitive types to conserve JVM memory and speed up execution.
package com.carrotsearch.hppc;
import static com.carrotsearch.hppc.Containers.*;
import static com.carrotsearch.hppc.HashContainers.*;
/**
* Same as {@link LongHashSet} but does not implement per-instance key mixing
* strategy and uses a simpler (faster) bit distribution function.
*
*
* Note: read about important differences between hash and
* scatter sets.
*
*
* @see LongHashSet
* @see HPPC interfaces diagram
*/
@javax.annotation.Generated(
date = "2015-05-07T09:33:04+0200",
value = "KTypeScatterSet.java")
public class LongScatterSet extends LongHashSet {
/**
* New instance with sane defaults.
*/
public LongScatterSet() {
this(DEFAULT_EXPECTED_ELEMENTS, DEFAULT_LOAD_FACTOR);
}
/**
* New instance with sane defaults.
*/
public LongScatterSet(int expectedElements) {
this(expectedElements, DEFAULT_LOAD_FACTOR);
}
/**
* New instance with sane defaults.
*/
@SuppressWarnings("deprecation")
public LongScatterSet(int expectedElements, double loadFactor) {
super(expectedElements, loadFactor, HashOrderMixing.none());
}
protected
int hashKey(long key) {
return BitMixer.mixPhi(key);
}
/**
* Create a set from a variable number of arguments or an array of
* long
. The elements are copied from the argument to the
* internal buffer.
*/
/* */
public static LongScatterSet from(long... elements) {
final LongScatterSet set = new LongScatterSet(elements.length);
set.addAll(elements);
return set;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy