@Generated(date="2017-07-11T19:16:32+0200",
value="KTypeVTypeIdentityHashMap.java")
public class ObjectFloatIdentityHashMap<KType>
extends ObjectFloatHashMap<KType>
Object to float, implemented using open
addressing with linear probing for collision resolution.
The difference with ObjectFloatHashMap is that it uses direct Object reference equality for comparison and
direct "address" System.identityHashCode(Object) for hashCode(), instead of using
the built-in ObjectFloatHashMap.hashCode() / ObjectFloatHashMap.equals(Object).
This implementation supports null keys.
ObjectFloatHashMap.EntryIterator, ObjectFloatHashMap.KeysCollection, ObjectFloatHashMap.KeysIterator, ObjectFloatHashMap.ValuesCollection, ObjectFloatHashMap.ValuesIteratorallocatedDefaultKey, allocatedDefaultKeyValue, assigned, defaultValue, entryIteratorPool, hash_cache, keys, loadFactor, values| Constructor and Description |
|---|
ObjectFloatIdentityHashMap()
Default constructor: Creates a hash map with the default capacity of
Containers.DEFAULT_EXPECTED_ELEMENTS,
load factor of HashContainers.DEFAULT_LOAD_FACTOR. |
ObjectFloatIdentityHashMap(int initialCapacity)
Creates a hash map with the given initial capacity, default load factor of
HashContainers.DEFAULT_LOAD_FACTOR. |
ObjectFloatIdentityHashMap(int initialCapacity,
double loadFactor)
Creates a hash map with the given initial capacity,
load factor.
|
ObjectFloatIdentityHashMap(ObjectFloatAssociativeContainer<KType> container)
Create a hash map from all key-value pairs of another container.
|
| Modifier and Type | Method and Description |
|---|---|
ObjectFloatIdentityHashMap<KType> |
clone() |
protected boolean |
equalKeys(KType a,
KType b)
Equality customization to only consider object identity, comparing
instances directly by ==.
|
static <KType> ObjectFloatIdentityHashMap<KType> |
from(KType[] keys,
float[] values)
Creates a hash map from two index-aligned arrays of key-value pairs.
|
static <KType> ObjectFloatIdentityHashMap<KType> |
from(ObjectFloatAssociativeContainer<KType> container)
Create a hash map from another associative container.
|
protected int |
hashKey(KType key)
Hash customization to only consider the identity hash code.
|
static <KType> ObjectFloatIdentityHashMap<KType> |
newInstance()
Create a new hash map without providing the full generic signature (constructor
shortcut).
|
static <KType> ObjectFloatIdentityHashMap<KType> |
newInstance(int initialCapacity,
double loadFactor)
Create a new hash map with initial capacity and load factor control.
|
addTo, capacity, clear, containsKey, equals, forEach, forEach, get, getDefaultValue, hashCode, isEmpty, iterator, keys, put, putAll, putAll, putIfAbsent, putOrAdd, remove, removeAll, removeAll, removeAll, setDefaultValue, size, toString, valuespublic ObjectFloatIdentityHashMap()
Containers.DEFAULT_EXPECTED_ELEMENTS,
load factor of HashContainers.DEFAULT_LOAD_FACTOR.
See class notes about hash distribution importance.
public ObjectFloatIdentityHashMap(int initialCapacity)
HashContainers.DEFAULT_LOAD_FACTOR.initialCapacity - Initial capacity (greater than zero and automatically
rounded to the next power of two).public ObjectFloatIdentityHashMap(int initialCapacity,
double loadFactor)
initialCapacity - Initial capacity (greater than zero and automatically
rounded to the next power of two).loadFactor - The load factor (greater than zero and smaller than 1).public ObjectFloatIdentityHashMap(ObjectFloatAssociativeContainer<KType> container)
protected int hashKey(KType key)
hashKey in class ObjectFloatHashMap<KType>key - Object to be hashed.ObjectFloatHashMap.hashCode();ObjectFloatHashMap.hashCode(),
ObjectFloatHashMap.equalKeys(Object, Object)protected boolean equalKeys(KType a, KType b)
equalKeys in class ObjectFloatHashMap<KType>a - not-null Object to be comparedb - not-null Object to be comparedObjectFloatHashMap.equals(Object).ObjectFloatHashMap.equals(Object),
ObjectFloatHashMap.hashKey(Object)public ObjectFloatIdentityHashMap<KType> clone()
ObjectFloatHashMapclone in class ObjectFloatHashMap<KType>public static <KType> ObjectFloatIdentityHashMap<KType> from(KType[] keys, float[] values)
public static <KType> ObjectFloatIdentityHashMap<KType> from(ObjectFloatAssociativeContainer<KType> container)
public static <KType> ObjectFloatIdentityHashMap<KType> newInstance()
public static <KType> ObjectFloatIdentityHashMap<KType> newInstance(int initialCapacity, double loadFactor)
Copyright © 2017. All rights reserved.