public class LongHashMap<V> extends LongMap<V> implements Serializable
LongMap.LongMapIterator<V>| Modifier and Type | Field and Description |
|---|---|
protected long |
hashSalt
Salt added to keys before hashing, so it is harder to trigger hash collision attack.
|
| Constructor and Description |
|---|
LongHashMap()
Constructs a new empty
HashMap instance. |
LongHashMap(int capacity)
Constructs a new
HashMap instance with the specified capacity. |
LongHashMap(int capacity,
float loadFactor)
Constructs a new
HashMap instance with the specified capacity and
load factor. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all mappings from this hash map, leaving it empty.
|
V |
get(long key)
Returns the value of the mapping with the specified key.
|
protected long |
hashSaltValue() |
static int |
intHash(int h) |
boolean |
isEmpty()
Returns whether this map is empty.
|
static int |
longHash(long key) |
LongMap.LongMapIterator<V> |
longMapIterator() |
V |
put(long key,
V value)
Maps the specified key to the specified value.
|
V |
remove(long key)
Removes the mapping with the specified key from this map.
|
int |
size()
Returns the number of elements in this map.
|
Iterator<V> |
valuesIterator() |
protected final long hashSalt
public LongHashMap()
HashMap instance.public LongHashMap(int capacity)
HashMap instance with the specified capacity.capacity - the initial capacity of this hash map.IllegalArgumentException - when the capacity is less than zero.public LongHashMap(int capacity,
float loadFactor)
HashMap instance with the specified capacity and
load factor.capacity - the initial capacity of this hash map.loadFactor - the initial load factor.IllegalArgumentException - when the capacity is less than zero or the load factor is
less or equal to zero.protected long hashSaltValue()
public void clear()
public V get(long key)
public boolean isEmpty()
public V remove(long key)
public int size()
public Iterator<V> valuesIterator()
valuesIterator in class LongMap<V>public LongMap.LongMapIterator<V> longMapIterator()
longMapIterator in class LongMap<V>public static int longHash(long key)
public static int intHash(int h)
Copyright © 2024. All rights reserved.