ObjectCollection<KType>, ObjectContainer<KType>, ObjectLookupContainer<KType>, ObjectSet<KType>, Preallocable, java.lang.Iterable<KType>@Generated(date="2018-05-21T12:24:05+0200", value="KTypeScatterSet.java") public class ObjectScatterSet<KType> extends ObjectHashSet<KType>
ObjectHashSet 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.
ObjectHashSet,
HPPC interfaces diagramObjectHashSet.EntryIteratorassigned, hasEmptyKey, keyMixer, keys, loadFactor, mask, orderMixer, resizeAt| Constructor | Description |
|---|---|
ObjectScatterSet() |
New instance with sane defaults.
|
ObjectScatterSet(int expectedElements) |
New instance with sane defaults.
|
ObjectScatterSet(int expectedElements,
double loadFactor) |
New instance with sane defaults.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected boolean |
equals(java.lang.Object v1,
java.lang.Object v2) |
|
static <KType> ObjectScatterSet<KType> |
from(KType... elements) |
Create a set from a variable number of arguments or an array of
Object. |
protected int |
hashKey(KType key) |
Returns a hash code for the given key.
|
int |
removeAll(ObjectLookupContainer<? super KType> c) |
Default implementation uses a predicate for removal.
|
int |
retainAll(ObjectLookupContainer<? super KType> c) |
Default implementation uses a predicate for retaining.
|
int |
retainAll(ObjectPredicate<? super KType> predicate) |
Default implementation redirects to
ObjectCollection.removeAll(ObjectPredicate) and
negates the predicate. |
<T> T[] |
toArray(java.lang.Class<T> componentClass) |
Copies all elements of this container to a dynamically created array of the
given component type.
|
java.lang.String |
toString() |
Convert the contents of this container to a human-friendly string.
|
finalize, getClass, notify, notifyAll, wait, wait, waitremoveAll, retainAll, retainAlltoArrayadd, addAll, addAll, addAll, allocateBuffers, allocateThenInsertThenRehash, clear, clone, contains, ensureCapacity, equals, forEach, hashCode, indexExists, indexGet, indexInsert, indexOf, indexReplace, isEmpty, iterator, rehash, release, remove, removeAll, removeAll, shiftConflictingKeys, size, toArray, verifyLoadFactor, visualizeKeyDistributionpublic ObjectScatterSet()
public ObjectScatterSet(int expectedElements)
public ObjectScatterSet(int expectedElements,
double loadFactor)
protected int hashKey(KType key)
ObjectHashSetObjectHashSet.keyMixer
to differentiate hash order of keys between hash containers. Helps
alleviate problems resulting from linear conflict resolution in open
addressing.
The output from this function should evenly distribute keys across the
entire integer range.hashKey in class ObjectHashSet<KType>@SafeVarargs public static <KType> ObjectScatterSet<KType> from(KType... elements)
Object. The elements are copied from the argument to the
internal buffer.public int removeAll(ObjectLookupContainer<? super KType> c)
removeAll in interface ObjectCollection<KType>public int retainAll(ObjectLookupContainer<? super KType> c)
retainAll in interface ObjectCollection<KType>public int retainAll(ObjectPredicate<? super KType> predicate)
ObjectCollection.removeAll(ObjectPredicate) and
negates the predicate.retainAll in interface ObjectCollection<KType>public <T> T[] toArray(java.lang.Class<T> componentClass)
ObjectContainertoArray in interface ObjectContainer<KType>public java.lang.String toString()
toString in class java.lang.Objectprotected boolean equals(java.lang.Object v1,
java.lang.Object v2)
Copyright © 2018 Carrot Search s.c.. All Rights Reserved.