Contents
Class Int3ObjectOpenHashMap<V>
java.lang.Object
com.hypixel.hytale.math.data.Int3ObjectOpenHashMap<V>
- Type Parameters:
V- value type (must not be null)
Open-addressed hash map keyed by three
int coordinates (x, y, z).
Keys are stored in a single stride-based int[] array ([x0, y0, z0, x1, y1, z1, ...])
to minimize field lookups and keep each entry's coordinates on the same cache line.
Uses linear probing with backward-shift deletion (no tombstones). Null values are disallowed;
a null in the values array indicates an empty slot.
Hashing uses Fibonacci hashing (Knuth 1973 — multiply by the golden-ratio constant, take top bits) which provides near-uniform slot distribution for sequential and clustered keys. The three coordinates are mixed via a MurmurHash3 64-bit finalizer (fmix64) before the Fibonacci index step.
Not thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionInt3ObjectOpenHashMap(int expectedSize) Int3ObjectOpenHashMap(int expectedSize, float loadFactor) Int3ObjectOpenHashMap(Int3ObjectOpenHashMap<? extends V> other) -
Method Summary
Modifier and TypeMethodDescriptionbooleanallMatch(TriIntObjPredicate<? super V> predicate) Whether every entry passes the predicate.voidclear()booleancontainsKey(int x, int y, int z) voidforEach(TriIntObjectConsumer<? super V> consumer) get(int x, int y, int z) booleanisEmpty()remove(int x, int y, int z) intsize()voidtrim()Shrinks the table to the smallest capacity that holds the entries.
-
Constructor Details
-
Int3ObjectOpenHashMap
public Int3ObjectOpenHashMap() -
Int3ObjectOpenHashMap
public Int3ObjectOpenHashMap(int expectedSize) -
Int3ObjectOpenHashMap
public Int3ObjectOpenHashMap(int expectedSize, float loadFactor) -
Int3ObjectOpenHashMap
-
-
Method Details
-
get
-
put
-
remove
-
containsKey
public boolean containsKey(int x, int y, int z) -
size
public int size() -
isEmpty
public boolean isEmpty() -
clear
public void clear() -
forEach
-
allMatch
Whether every entry passes the predicate. Stops at the first entry that does not. -
trim
public void trim()Shrinks the table to the smallest capacity that holds the entries.
-