LongObjectMap
that uses open addressing for keys.
To minimize the memory footprint, this class uses open addressing rather than chaining.
Collisions are resolved using linear probing. Deletions implement compaction, so cost of
remove can approach O(N) for full maps, which makes a small loadFactor recommended.
Modifier and Type | Class and Description |
---|---|
private class | LongObjectHashMap.
Set implementation for iterating over the entries of the map. |
private class | LongObjectHashMap.
Set implementation for iterating over the keys. |
pack-priv class | LongObjectHashMap.
A single entry in the map. |
private class | LongObjectHashMap.
Iterator used by the |
private class | LongObjectHashMap.
Iterator over primitive entries. |
Modifier and Type | Field and Description |
---|---|
public static final int | DEFAULT_CAPACITY
Default initial capacity. |
public static final float | DEFAULT_LOAD_FACTOR
Default load factor. |
private final Iterable | |
private final Set | |
private long[] | |
private final Set | |
private final float | loadFactor
The load factor for the map. |
private int | |
private int | maxSize
The maximum number of elements allowed without allocating more space. |
private static final Object | NULL_VALUE
Placeholder for null values, so we can use the actual null to mean available. |
private int | |
private V[] |
Access | Constructor and Description |
---|---|
public | |
public | |
public |
Modifier and Type | Method and Description |
---|---|
private int | |
public void | clear()
Implements java. |
public boolean | containsKey(long key)
Implements io. |
public boolean | containsKey(Object
key whose presence in this map is to be tested key)Implements java. true if this map contains a mapping for the specified
key.
|
public boolean | containsValue(Object
value whose presence in this map is to be tested value)Implements java. true if this map maps one or more keys to the
specified value.
|
public Iterable | entries()
Implements io. |
public Set | entrySet()
Implements java. Set view of the mappings contained in this map.
|
public boolean | equals(Object
object to be compared for equality with this map obj)Overrides java. Implements java. |
public V | get(long
the key whose associated value is to be returned. key)Implements io. |
public V | get(Object
the key whose associated value is to be returned key)Implements java. null if this map contains no mapping for the key.
|
private void | |
public int | hashCode()
Overrides java. Implements java. |
private static int | |
private int | |
private int | Returns: the index where the key was found, or-1 if no entry is found for that key.the key for an entry in the map. key)Locates the index for the given key. |
public boolean | |
public Set | |
protected String | keyToString(long key)
Helper method called by |
private long | |
private int | |
public V | put(long
the key of the entry. key, V the value of the entry. value)Implements io. |
public V | put(Long
key with which the specified value is to be associated key, V value to be associated with the specified key value)Implements java. |
public void | putAll(Map<? extends Long, ? extends V>
mappings to be stored in this map sourceMap)Implements java. |
private void | |
public V | remove(long
the key for the entry to be removed from this map. key)Implements io. |
public V | remove(Object
key whose mapping is to be removed from the map key)Implements java. |
private boolean | Returns: true if the next item was moved back. false otherwise.the index position of the element to remove. index)Removes entry at the given index position. |
public int | |
private static <T> T | |
private static <T> T | |
public String | |
public Collection | values()
Implements java. Collection view of the values contained in this map.
|