Top Description Inners Fields Constructors Methods
com.carrotsearch.hppc

public Class ObjectHashSet<KType>

extends AbstractObjectCollection<KType>
implements ObjectLookupContainer<KType>, ObjectSet<KType>, Preallocable, Cloneable, Accountable
Class Inheritance
All Implemented Interfaces
com.carrotsearch.hppc.Accountable, java.lang.Cloneable, com.carrotsearch.hppc.Preallocable, com.carrotsearch.hppc.ObjectSet, com.carrotsearch.hppc.ObjectCollection, com.carrotsearch.hppc.ObjectContainer, java.lang.Iterable, com.carrotsearch.hppc.ObjectLookupContainer
Known Direct Subclasses
com.carrotsearch.hppc.ObjectIdentityHashSet
Annotations
@SuppressWarnings:unchecked
@Generated:KTypeHashSet.java
date:2024-06-04T15:20:16+0200
Static Imports
com.carrotsearch.hppc.Containers.*, com.carrotsearch.hppc.HashContainers.*

A hash set of Objects, implemented using open addressing with linear probing for collision resolution.
See Also
HPPC interfaces diagram

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
ObjectHashSet.EntryIterator

An iterator implementation for iterator.

Field Summary

Modifier and TypeField and Description
protected int
assigned

The number of stored keys (assigned key slots), excluding the special "empty" key, if any.

protected boolean
hasEmptyKey

Special treatment for the "empty slot" key marker.

protected int
iterationSeed

Seed used to ensure the hash iteration order is different from an iteration to another.

public Object[]
keys

The hash array holding keys.

protected double
loadFactor

The load factor for keys.

protected int
mask

Mask for slot scans in keys.

protected int
resizeAt

Expand (rehash) keys when assigned hits this value.

Constructor Summary

AccessConstructor and Description
public
ObjectHashSet()

New instance with sane defaults.

public
ObjectHashSet(int expectedElements)

New instance with sane defaults.

public
ObjectHashSet(int
The expected number of elements guaranteed not to cause a rehash (inclusive).
expectedElements
,
double
The load factor for internal buffers. Insane load factors (zero, full capacity) are rejected by verifyLoadFactor(double).
loadFactor
)

New instance with the provided defaults.

public
ObjectHashSet(ObjectContainer<? extends KType> container)

New instance copying elements from another ObjectContainer.

Method Summary

Modifier and TypeMethod and Description
public boolean
add(KType key)

Implements com.carrotsearch.hppc.ObjectSet.add.

Adds k to the set.

public final int

Returns:

Returns the number of elements actually added as a result of this call (not previously present in the set).
addAll
(KType... elements)

Adds all elements from the given list (vararg) to this set.

public int

Returns:

Returns the number of elements actually added as a result of this call (not previously present in the set).
addAll
(ObjectContainer<? extends KType> container)

Implements com.carrotsearch.hppc.ObjectSet.addAll.

Adds all elements from the given ObjectContainer to this set.

public int

Returns:

Returns the number of elements actually added as a result of this call (not previously present in the set).
addAll
(Iterable<? extends ObjectCursor<? extends KType>> iterable)

Adds all elements from the given iterable to this set.

protected void
allocateBuffers(int arraySize)

Allocate new internal buffers.

protected void
allocateThenInsertThenRehash(int slot, KType pendingKey)

This method is invoked when there is a new key to be inserted into the buffer but there is not enough empty slots to do so.

public void
clear()

Implements com.carrotsearch.hppc.ObjectCollection.clear.

Removes all elements from this collection.

public ObjectHashSet<KType>
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public boolean
public void
ensureCapacity(int
The total number of elements, inclusive.
expectedElements
)

Implements com.carrotsearch.hppc.Preallocable.ensureCapacity.

Ensure this container can hold at least the given number of elements without resizing its buffers.

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public <T extends ObjectProcedure<? super KType>> T
forEach(T procedure)

Implements com.carrotsearch.hppc.ObjectContainer.forEach, com.carrotsearch.hppc.ObjectContainer.forEach.

Applies a procedure to all container elements.

public <T extends ObjectPredicate<? super KType>> T
forEach(T predicate)

Implements com.carrotsearch.hppc.ObjectContainer.forEach, com.carrotsearch.hppc.ObjectContainer.forEach.

Applies a procedure to all container elements.

public static <KType> ObjectHashSet<KType>
from(KType... elements)

Create a set from a variable number of arguments or an array of Object.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

protected int
hashKey(KType key)

Returns a hash code for the given key.

public boolean

Returns:

Returns true if the index corresponds to an existing key or false otherwise. This is equivalent to checking whether the index is a positive value (existing keys) or a negative value (non-existing keys).
indexExists
(int
The index of a given key, as returned from indexOf.
index
)

public KType

Returns:

Returns the equivalent key currently stored in the set.
indexGet
(int
The index of an existing key.
index
)

Returns the exact value of the existing key.

public void
indexInsert(int
The index of a previously non-existing key, as returned from indexOf.
index
,
KType key)

Inserts a key for an index that is not present in the set.

public int

Returns:

A non-negative value of the logical "index" of the key in the set or a negative value if the key did not exist.
indexOf
(KType
The key to locate in the set.
key
)

Returns a logical "index" of a given key that can be used to speed up follow-up logic in certain scenarios (conditional logic).

public void
indexRemove(int
The index of the key to remove, as returned from indexOf.
index
)

Removes a key at an index previously acquired from indexOf.

public KType

Returns:

Returns the previous key stored in the set.
indexReplace
(int
The index of an existing key.
index
,
KType
The key to put in the set as a replacement. Must be equivalent to the key currently stored at the provided index.
equivalentKey
)

Replaces the existing equivalent key with the given one and returns any previous value stored for that key.

public boolean
isEmpty()

Implements com.carrotsearch.hppc.ObjectContainer.isEmpty.

Shortcut for size() == 0.

public Iterator<ObjectCursor<KType>>
iterator()

Implements com.carrotsearch.hppc.ObjectContainer.iterator.

Returns an iterator to a cursor traversing the collection.

protected int
nextIterationSeed()

Provides the next iteration seed used to build the iteration starting slot and offset increment.

public long
public long
ramBytesUsed()

Implements com.carrotsearch.hppc.Accountable.ramBytesUsed.

Bytes that is actually been used

protected void
rehash(KType[] fromKeys)

Rehash from old buffers to new buffers.

public void
release()

Implements com.carrotsearch.hppc.ObjectCollection.release.

Removes all elements from the collection and additionally releases any internal buffers.

public boolean
remove(KType key)

An alias for the (preferred) removeAll.

public int
removeAll(KType
Element to be removed from this collection, if present.
key
)

Implements com.carrotsearch.hppc.ObjectCollection.removeAll.

Removes all occurrences of e from this collection.

public int

Returns:

Returns the number of elements actually removed as a result of this call.
removeAll
(ObjectContainer<? super KType>
Element to be removed from this collection, if present.
other
)

Implements com.carrotsearch.hppc.ObjectCollection.removeAll.

Removes all keys present in a given container.

public int
removeAll(ObjectPredicate<? super KType> predicate)

Implements com.carrotsearch.hppc.ObjectCollection.removeAll, com.carrotsearch.hppc.ObjectCollection.removeAll.

Removes all elements in this collection for which the given predicate returns true .

private boolean
sameKeys(ObjectSet<?> other)

Return true if all keys of some other container exist in this container.

protected void
shiftConflictingKeys(int gapSlot)

Shift all the slot-conflicting keys allocated to (and including) slot.

public int
size()

Implements com.carrotsearch.hppc.ObjectContainer.size.

Return the current number of elements in this container.

public Object[]
toArray()

Overrides com.carrotsearch.hppc.AbstractObjectCollection.toArray.

Implements com.carrotsearch.hppc.ObjectContainer.toArray.

Copies all elements of this container to an array.

protected double
verifyLoadFactor(double loadFactor)

Validate load factor range and return it.

public String
visualizeKeyDistribution(int
The number of characters to "squeeze" the entire buffer into.
characters
)

Implements com.carrotsearch.hppc.ObjectSet.visualizeKeyDistribution.

Visually depict the distribution of keys.

Inherited from com.carrotsearch.hppc.AbstractObjectCollection:
equalsremoveAllretainAllretainAlltoArraytoString

Field Detail

assignedback to summary
protected int assigned

The number of stored keys (assigned key slots), excluding the special "empty" key, if any.

See Also
size(), hasEmptyKey
hasEmptyKeyback to summary
protected boolean hasEmptyKey

Special treatment for the "empty slot" key marker.

iterationSeedback to summary
protected int iterationSeed

Seed used to ensure the hash iteration order is different from an iteration to another.

keysback to summary
public Object[] keys

The hash array holding keys.

loadFactorback to summary
protected double loadFactor

The load factor for keys.

maskback to summary
protected int mask

Mask for slot scans in keys.

resizeAtback to summary
protected int resizeAt

Expand (rehash) keys when assigned hits this value.

Constructor Detail

ObjectHashSetback to summary
public ObjectHashSet()

New instance with sane defaults.

See Also
ObjectHashSet(int, double)
ObjectHashSetback to summary
public ObjectHashSet(int expectedElements)

New instance with sane defaults.

See Also
ObjectHashSet(int, double)
ObjectHashSetback to summary
public ObjectHashSet(int expectedElements, double loadFactor)

New instance with the provided defaults.

Parameters
expectedElements:int

The expected number of elements guaranteed not to cause a rehash (inclusive).

loadFactor:double

The load factor for internal buffers. Insane load factors (zero, full capacity) are rejected by verifyLoadFactor(double).

ObjectHashSetback to summary
public ObjectHashSet(ObjectContainer<? extends KType> container)

New instance copying elements from another ObjectContainer.

Method Detail

addback to summary
public boolean add(KType key)

Implements com.carrotsearch.hppc.ObjectSet.add.

Doc from com.carrotsearch.hppc.ObjectSet.add.

Adds k to the set.

Returns:boolean

Returns true if this element was not part of the set before. Returns false if an equal element is already part of the set, does not replace the existing element with the argument.

Annotations
@Override
addAllback to summary
public final int addAll(KType... elements)

Adds all elements from the given list (vararg) to this set.

Returns:int

Returns the number of elements actually added as a result of this call (not previously present in the set).

Annotations
@SafeVarargs
addAllback to summary
public int addAll(ObjectContainer<? extends KType> container)

Implements com.carrotsearch.hppc.ObjectSet.addAll.

Adds all elements from the given ObjectContainer to this set.

Returns:int

Returns the number of elements actually added as a result of this call (not previously present in the set).

addAllback to summary
public int addAll(Iterable<? extends ObjectCursor<? extends KType>> iterable)

Adds all elements from the given iterable to this set.

Returns:int

Returns the number of elements actually added as a result of this call (not previously present in the set).

allocateBuffersback to summary
protected void allocateBuffers(int arraySize)

Allocate new internal buffers. This method attempts to allocate and assign internal buffers atomically (either allocations succeed or not).

allocateThenInsertThenRehashback to summary
protected void allocateThenInsertThenRehash(int slot, KType pendingKey)

This method is invoked when there is a new key to be inserted into the buffer but there is not enough empty slots to do so.

New buffers are allocated. If this succeeds, we know we can proceed with rehashing so we assign the pending element to the previous buffer (possibly violating the invariant of having at least one empty slot) and rehash all keys, substituting new buffers at the end.

clearback to summary
public void clear()

Implements com.carrotsearch.hppc.ObjectCollection.clear.

Doc from com.carrotsearch.hppc.ObjectCollection.clear.

Removes all elements from this collection.

Annotations
@Override
cloneback to summary
public ObjectHashSet<KType> clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:ObjectHashSet<KType>

a clone of this instance.

Annotations
@Override
containsback to summary
public boolean contains(KType key)

Implements com.carrotsearch.hppc.ObjectLookupContainer.contains, com.carrotsearch.hppc.ObjectContainer.contains.

Doc from com.carrotsearch.hppc.ObjectContainer.contains.

Lookup a given element in the container. This operation has no speed guarantees (may be linear with respect to the size of this container).

Returns:boolean

Returns true if this container has an element equal to e.

Annotations
@Override
ensureCapacityback to summary
public void ensureCapacity(int expectedElements)

Implements com.carrotsearch.hppc.Preallocable.ensureCapacity.

Ensure this container can hold at least the given number of elements without resizing its buffers.

Parameters
expectedElements:int

The total number of elements, inclusive.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
forEachback to summary
public <T extends ObjectProcedure<? super KType>> T forEach(T procedure)

Implements com.carrotsearch.hppc.ObjectContainer.forEach, com.carrotsearch.hppc.ObjectContainer.forEach.

Doc from com.carrotsearch.hppc.ObjectContainer.forEach.

Applies a procedure to all container elements. Returns the argument (any subclass of ObjectProcedure. This lets the caller to call methods of the argument by chaining the call (even if the argument is an anonymous type) to retrieve computed values, for example (IntContainer):

int count = container.forEach(new IntProcedure() {
  int count; // this is a field declaration in an anonymous class.

  public void apply(int value) {
    count++;
  }
}).count;
Annotations
@Override
forEachback to summary
public <T extends ObjectPredicate<? super KType>> T forEach(T predicate)

Implements com.carrotsearch.hppc.ObjectContainer.forEach, com.carrotsearch.hppc.ObjectContainer.forEach.

Doc from com.carrotsearch.hppc.ObjectContainer.forEach.

Applies a procedure to all container elements. Returns the argument (any subclass of ObjectProcedure. This lets the caller to call methods of the argument by chaining the call (even if the argument is an anonymous type) to retrieve computed values, for example (IntContainer):

int count = container.forEach(new IntProcedure() {
  int count; // this is a field declaration in an anonymous class.

  public void apply(int value) {
    count++;
  }
}).count;
Annotations
@Override
fromback to summary
public static <KType> ObjectHashSet<KType> from(KType... elements)

Create a set from a variable number of arguments or an array of Object. The elements are copied from the argument to the internal buffer.

Annotations
@SafeVarargs
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
hashKeyback to summary
protected int hashKey(KType key)

Returns a hash code for the given key.

The output from this function should evenly distribute keys across the entire integer range.

indexExistsback to summary
public boolean indexExists(int index)
Parameters
index:int

The index of a given key, as returned from indexOf.

Returns:boolean

Returns true if the index corresponds to an existing key or false otherwise. This is equivalent to checking whether the index is a positive value (existing keys) or a negative value (non-existing keys).

See Also
indexOf
indexGetback to summary
public KType indexGet(int index)

Returns the exact value of the existing key. This method makes sense for sets of objects which define custom key-equality relationship.

Parameters
index:int

The index of an existing key.

Returns:KType

Returns the equivalent key currently stored in the set.

Exceptions
AssertionError:
If assertions are enabled and the index does not correspond to an existing key.
See Also
indexOf
indexInsertback to summary
public void indexInsert(int index, KType key)

Inserts a key for an index that is not present in the set. This method may help in avoiding double recalculation of the key's hash.

Parameters
index:int

The index of a previously non-existing key, as returned from indexOf.

Exceptions
AssertionError:
If assertions are enabled and the index does not correspond to an existing key.
See Also
indexOf
indexOfback to summary
public int indexOf(KType key)

Returns a logical "index" of a given key that can be used to speed up follow-up logic in certain scenarios (conditional logic).

The semantics of "indexes" are not strictly defined. Indexes may (and typically won't be) contiguous.

The index is valid only between modifications (it will not be affected by read-only operations).

Parameters
key:KType

The key to locate in the set.

Returns:int

A non-negative value of the logical "index" of the key in the set or a negative value if the key did not exist.

See Also
indexExists, indexGet, indexInsert, indexReplace
indexRemoveback to summary
public void indexRemove(int index)

Removes a key at an index previously acquired from indexOf.

Parameters
index:int

The index of the key to remove, as returned from indexOf.

Exceptions
AssertionError:
If assertions are enabled and the index does not correspond to an existing key.
See Also
indexOf
indexReplaceback to summary
public KType indexReplace(int index, KType equivalentKey)

Replaces the existing equivalent key with the given one and returns any previous value stored for that key.

Parameters
index:int

The index of an existing key.

equivalentKey:KType

The key to put in the set as a replacement. Must be equivalent to the key currently stored at the provided index.

Returns:KType

Returns the previous key stored in the set.

Exceptions
AssertionError:
If assertions are enabled and the index does not correspond to an existing key.
See Also
indexOf
isEmptyback to summary
public boolean isEmpty()

Implements com.carrotsearch.hppc.ObjectContainer.isEmpty.

Doc from com.carrotsearch.hppc.ObjectContainer.isEmpty.

Shortcut for size() == 0.

Annotations
@Override
iteratorback to summary
public Iterator<ObjectCursor<KType>> iterator()

Implements com.carrotsearch.hppc.ObjectContainer.iterator.

Doc from com.carrotsearch.hppc.ObjectContainer.iterator.

Returns an iterator to a cursor traversing the collection. The order of traversal is not defined. More than one cursor may be active at a time. The behavior of iterators is undefined if structural changes are made to the underlying collection.

The iterator is implemented as a cursor and it returns the same cursor instance on every call to Iterator#next() (to avoid boxing of primitive types). To read the current list's value (or index in the list) use the cursor's public fields. An example is shown below.

for (ObjectCursor<Object> c : container) {
  System.out.println("index=" + c.index + " value=" + c.value);
}
Returns:Iterator<ObjectCursor<KType>>

Doc from java.lang.Iterable.iterator.

an Iterator.

Annotations
@Override
nextIterationSeedback to summary
protected int nextIterationSeed()

Provides the next iteration seed used to build the iteration starting slot and offset increment. This method does not need to be synchronized, what matters is that each thread gets a sequence of varying seeds.

ramBytesAllocatedback to summary
public long ramBytesAllocated()

Implements com.carrotsearch.hppc.Accountable.ramBytesAllocated.

Doc from com.carrotsearch.hppc.Accountable.ramBytesAllocated.

Allocated memory estimation

Returns:long

Ram allocated in bytes

Annotations
@Override
ramBytesUsedback to summary
public long ramBytesUsed()

Implements com.carrotsearch.hppc.Accountable.ramBytesUsed.

Doc from com.carrotsearch.hppc.Accountable.ramBytesUsed.

Bytes that is actually been used

Returns:long

Ram used in bytes

Annotations
@Override
rehashback to summary
protected void rehash(KType[] fromKeys)

Rehash from old buffers to new buffers.

releaseback to summary
public void release()

Implements com.carrotsearch.hppc.ObjectCollection.release.

Doc from com.carrotsearch.hppc.ObjectCollection.release.

Removes all elements from the collection and additionally releases any internal buffers. Typically, if the object is to be reused, a simple clear() should be a better alternative since it'll avoid reallocation.

Annotations
@Override
removeback to summary
public boolean remove(KType key)

An alias for the (preferred) removeAll.

removeAllback to summary
public int removeAll(KType key)

Implements com.carrotsearch.hppc.ObjectCollection.removeAll.

Doc from com.carrotsearch.hppc.ObjectCollection.removeAll.

Removes all occurrences of e from this collection.

Parameters
key:KType

Element to be removed from this collection, if present.

Returns:int

The number of removed elements as a result of this call.

Annotations
@Override
removeAllback to summary
public int removeAll(ObjectContainer<? super KType> other)

Implements com.carrotsearch.hppc.ObjectCollection.removeAll.

Removes all keys present in a given container.

Parameters
other:ObjectContainer<? super KType>

Doc from com.carrotsearch.hppc.ObjectCollection.removeAll.

Element to be removed from this collection, if present.

Returns:int

Returns the number of elements actually removed as a result of this call.

removeAllback to summary
public int removeAll(ObjectPredicate<? super KType> predicate)

Implements com.carrotsearch.hppc.ObjectCollection.removeAll, com.carrotsearch.hppc.ObjectCollection.removeAll.

Doc from com.carrotsearch.hppc.ObjectCollection.removeAll.

Removes all elements in this collection for which the given predicate returns true .

Returns:int

Returns the number of removed elements.

Annotations
@Override
sameKeysback to summary
private boolean sameKeys(ObjectSet<?> other)

Return true if all keys of some other container exist in this container. Equality comparison is performed with this object's equals(Object, Object) method.

shiftConflictingKeysback to summary
protected void shiftConflictingKeys(int gapSlot)

Shift all the slot-conflicting keys allocated to (and including) slot.

sizeback to summary
public int size()

Implements com.carrotsearch.hppc.ObjectContainer.size.

Doc from com.carrotsearch.hppc.ObjectContainer.size.

Return the current number of elements in this container. The time for calculating the container's size may take O(n) time, although implementing classes should try to maintain the current size and return in constant time.

Annotations
@Override
toArrayback to summary
public Object[] toArray()

Overrides com.carrotsearch.hppc.AbstractObjectCollection.toArray.

Implements com.carrotsearch.hppc.ObjectContainer.toArray.

Doc from com.carrotsearch.hppc.ObjectContainer.toArray.

Copies all elements of this container to an array.

The returned array is always a copy, regardless of the storage used by the container.

Annotations
@Override
verifyLoadFactorback to summary
protected double verifyLoadFactor(double loadFactor)

Validate load factor range and return it. Override and suppress if you need insane load factors.

visualizeKeyDistributionback to summary
public String visualizeKeyDistribution(int characters)

Implements com.carrotsearch.hppc.ObjectSet.visualizeKeyDistribution.

Doc from com.carrotsearch.hppc.ObjectSet.visualizeKeyDistribution.

Visually depict the distribution of keys.

Parameters
characters:int

The number of characters to "squeeze" the entire buffer into.

Returns:String

Returns a sequence of characters where '.' depicts an empty fragment of the internal buffer and 'X' depicts full or nearly full capacity within the buffer's range and anything between 1 and 9 is between.

Annotations
@Override
com.carrotsearch.hppc back to summary

protected final Class ObjectHashSet.EntryIterator

extends AbstractIterator<ObjectCursor<KType>>
Class Inheritance

An iterator implementation for iterator.

Field Summary

Modifier and TypeField and Description
private final ObjectCursor<KType>
private final int
private int
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected ObjectCursor<KType>
fetch()

Implements abstract com.carrotsearch.hppc.AbstractIterator.fetch.

Fetch next element.

Inherited from com.carrotsearch.hppc.AbstractIterator:
donehasNextnextremove

Field Detail

cursorback to summary
private final ObjectCursor<KType> cursor
incrementback to summary
private final int increment
indexback to summary
private int index
slotback to summary
private int slot

Constructor Detail

EntryIteratorback to summary
public EntryIterator()

Method Detail

fetchback to summary
protected ObjectCursor<KType> fetch()

Implements abstract com.carrotsearch.hppc.AbstractIterator.fetch.

Doc from com.carrotsearch.hppc.AbstractIterator.fetch.

Fetch next element. The implementation must return done() when all elements have been fetched.

Returns:ObjectCursor<KType>

Returns the next value for the iterator or chain-calls done().

Annotations
@Override