public class IntLongHppcOpenHashMap extends AbstractWritableIntLongMap
Modifier and Type | Field and Description |
---|---|
protected IntLongOpenHashMap |
myMap |
myModCount
DEFAULT_VALUE, EMPTY
Constructor and Description |
---|
IntLongHppcOpenHashMap() |
IntLongHppcOpenHashMap(int initialCapacity) |
IntLongHppcOpenHashMap(int initialCapacity,
float loadFactor) |
Modifier and Type | Method and Description |
---|---|
long |
addTo(int key,
long additionValue) |
void |
clear()
Removes all entries from this map.
|
boolean |
containsKey(int key) |
static IntLongHppcOpenHashMap |
createForAdd(int count)
Creates new hashmap with default load factor
|
static IntLongHppcOpenHashMap |
createForAdd(int count,
float loadFactor)
Creates new hashmap with the specified load factor
that is garanteed to not invoke
resize after adding count elements |
static IntLongHppcOpenHashMap |
createFrom(int[] keys,
long[] values) |
static IntLongHppcOpenHashMap |
createFrom(IntIterable keys,
LongIterable values) |
long |
get(int key) |
IntLongIterator |
iterator() |
IntIterator |
keysIterator() |
long |
lget()
Returns the last value saved in a call to
containsKey(int) . |
long |
lset(long value)
Sets the value corresponding to the key saved in the last
call to
containsKey(int) , if and only if the key exists
in the map already. |
int |
lslot() |
protected long |
putImpl(int key,
long value)
put element without invocation of
AbstractWritableIntLongMap#modified() |
long |
putOrAdd(int key,
long putValue,
long additionValue)
Trove-inspired API method.
|
boolean |
remove(int key,
long value)
Removes the entry for the key only if the key is currently mapped to the given value.
|
protected long |
removeImpl(int key)
remove element without invocation of
AbstractWritableIntLongMap#modified() |
int |
size() |
LongIterator |
valuesIterator() |
add, containsKeys, equals, hashCode, isEmpty, keySet, modified, put, putAll, putAll, putAll, putAllKeys, putIfAbsent, remove, removeAll, removeAll, toString, toString, toTableString
public IntLongHppcOpenHashMap()
public IntLongHppcOpenHashMap(int initialCapacity)
public IntLongHppcOpenHashMap(int initialCapacity, float loadFactor)
public static IntLongHppcOpenHashMap createFrom(IntIterable keys, LongIterable values)
public static IntLongHppcOpenHashMap createFrom(int[] keys, long[] values)
public static IntLongHppcOpenHashMap createForAdd(int count, float loadFactor)
resize
after adding count
elementscount
and loadFactor
public static IntLongHppcOpenHashMap createForAdd(int count)
createForAdd(int, float)
public boolean containsKey(int key)
key
. Otherwise falsepublic int size()
@NotNull public IntLongIterator iterator()
IntLongIterator.EMPTY
public IntIterator keysIterator()
public LongIterator valuesIterator()
public long get(int key)
key
. Otherwise returns default value.public void clear()
WritableIntLongMap
protected long putImpl(int key, long value)
AbstractWritableIntLongMap
AbstractWritableIntLongMap#modified()
putImpl
in class AbstractWritableIntLongMap
public long putOrAdd(int key, long putValue, long additionValue)
if (containsKey(key)) { long v = (long) (lget() + additionValue); lset(v); return v; } else { put(key, putValue); return putValue; }
key
- The key of the value to adjust.putValue
- The value to put if key
does not exist.additionValue
- The value to add to the existing value if key
exists.key
(after changes).public long addTo(int key, long additionValue)
public long lget()
containsKey(int)
.containsKey(int)
public long lset(long value)
containsKey(int)
, if and only if the key exists
in the map already.containsKey(int)
public int lslot()
containsKey(int)
if
it returned true
.containsKey(int)
protected long removeImpl(int key)
AbstractWritableIntLongMap
AbstractWritableIntLongMap#modified()
removeImpl
in class AbstractWritableIntLongMap
public boolean remove(int key, long value)
WritableIntLongMap
remove
in interface WritableIntLongMap
remove
in class AbstractWritableIntLongMap
true
if the size of this map has changed. Otherwise false
.