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 int
add(K value)
void
clear()
private int
findFree(int size)
private int
findIndex(K value, int id)
K
get(int index)
private int
getIdealIndex(K value)
private int
getIdFromIndex(int index)
int
getRawId(K entry)
Iterator<K>
iterator()
private int
nextId()
void
put(K value, int id)
private void
resize(int newSize)
int
size()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getRawId
in interfaceIndexedIterable<K>
-
get
- Specified by:
get
in 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()
-