Package net.minecraft.util.collection
Class Int2ObjectBiMap<K>
java.lang.Object
net.minecraft.util.collection.Int2ObjectBiMap<K>
- All Implemented Interfaces:
Iterable<K>,IndexedIterable<K>
public class Int2ObjectBiMap<K> extends Object implements IndexedIterable<K>
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Int2ObjectBiMap(int size) -
Method Summary
Modifier and Type Method Description intadd(K value)voidclear()private intfindFree(int size)private intfindIndex(K value, int id)Kget(int index)private intgetIdealIndex(K value)private intgetIdFromIndex(int index)intgetRawId(K entry)Iterator<K>iterator()private intnextId()voidput(K value, int id)private voidresize(int newSize)intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY
-
values
-
ids
private int[] ids -
idToValues
-
nextId
private int nextId -
size
private int size
-
-
Constructor Details
-
Int2ObjectBiMap
public Int2ObjectBiMap(int size)
-
-
Method Details
-
getRawId
- Specified by:
getRawIdin interfaceIndexedIterable<K>
-
get
- Specified by:
getin interfaceIndexedIterable<K>
-
getIdFromIndex
private int getIdFromIndex(int index) -
add
-
nextId
private int nextId() -
resize
private void resize(int newSize) -
put
-
getIdealIndex
-
findIndex
-
findFree
private int findFree(int size) -
iterator
-
clear
public void clear() -
size
public int size()
-