public class Int2ObjectBiMap<K> extends Object implements IndexedIterable<K>
Modifier and Type | Field and Description |
---|---|
private static Object |
EMPTY |
private int[] |
ids |
private K[] |
idToValues |
private int |
nextId |
private int |
size |
private K[] |
values |
Constructor and Description |
---|
Int2ObjectBiMap(int size) |
Modifier and Type | Method and 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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
private static final Object EMPTY
private K[] values
private int[] ids
private K[] idToValues
private int nextId
private int size
public int getRawId(@Nullable K entry)
getRawId
in interface IndexedIterable<K>
@Nullable public K get(int index)
get
in interface IndexedIterable<K>
private int getIdFromIndex(int index)
public int add(K value)
private int nextId()
private void resize(int newSize)
public void put(K value, int id)
private int findFree(int size)
public void clear()
public int size()