Class CrudeIncrementalIntIdentityHashBiMap<K>
java.lang.Object
net.minecraft.util.CrudeIncrementalIntIdentityHashBiMap<K>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCrudeIncrementalIntIdentityHashBiMap(int capacity) privateCrudeIncrementalIntIdentityHashBiMap(K[] keys, int[] values, K[] byId, int nextId, int size) -
Method Summary
Modifier and TypeMethodDescriptionintAdds the given object while expanding this mapvoidaddMapping(K key, int id) Puts the provided object value with the integer key.@Nullable KbyId(int id) voidclear()booleancontains(int id) booleancopy()static <A> CrudeIncrementalIntIdentityHashBiMap<A> create(int initialCapacity) private intfindEmpty(int startFrom) intGets the integer ID we use to identify the given object.private intgetValue(int index) private voidgrow(int newSize) Rehashes the map to the new capacityprivate intprivate intiterator()private intnextId()intsize()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IdMap
byIdOrThrow, getIdOrThrowMethods inherited from interface 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 capacity) -
CrudeIncrementalIntIdentityHashBiMap
-
-
Method Details
-
create
-
getId
-
byId
-
getValue
private int getValue(int index) -
contains
-
contains
public boolean contains(int id) -
add
Adds the given object while expanding this map -
nextId
private int nextId() -
grow
private void grow(int newSize) Rehashes the map to the new capacity -
addMapping
Puts the provided object value with the integer key. -
hash
-
indexOf
-
findEmpty
private int findEmpty(int startFrom) -
iterator
-
clear
public void clear() -
size
-
copy
-