Package net.minecraft.util
Class CrudeIncrementalIntIdentityHashBiMap<K>
java.lang.Object
net.minecraft.util.CrudeIncrementalIntIdentityHashBiMap<K>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCrudeIncrementalIntIdentityHashBiMap(int size) privateCrudeIncrementalIntIdentityHashBiMap(K[] keys, int[] values, K[] byId, int nextId, int size) -
Method Summary
Modifier and TypeMethodDescriptionintAdds the given object while expanding this mapvoidaddMapping(K object, int intKey) Puts the provided object value with the integer key.byId(int value) voidclear()booleancontains(int value) booleancopy()static <A> CrudeIncrementalIntIdentityHashBiMap<A> create(int size) private intfindEmpty(int startIndex) intGets the integer ID we use to identify the given object.private intgetValue(int key) private voidgrow(int capacity) Rehashes the map to the new capacityprivate intprivate intiterator()private intnextId()intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.core.IdMap
byIdOrThrow, getIdOrThrowMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
NOT_FOUND
private static final int NOT_FOUND- See Also:
-
EMPTY_SLOT
-
LOADFACTOR
private static final float LOADFACTOR- See Also:
-
keys
-
values
private int[] values -
byId
-
nextId
private int nextId -
size
private int size
-
-
Constructor Details
-
CrudeIncrementalIntIdentityHashBiMap
private CrudeIncrementalIntIdentityHashBiMap(int size) -
CrudeIncrementalIntIdentityHashBiMap
-
-
Method Details
-
create
-
getId
Gets the integer ID we use to identify the given object. -
byId
-
getValue
private int getValue(int key) -
contains
-
contains
public boolean contains(int value) -
add
Adds the given object while expanding this map -
nextId
private int nextId() -
grow
private void grow(int capacity) Rehashes the map to the new capacity -
addMapping
Puts the provided object value with the integer key. -
hash
-
indexOf
-
findEmpty
private int findEmpty(int startIndex) -
iterator
-
clear
public void clear() -
size
public int size() -
copy
-