public class TObjectFloatHashMap<K> extends TObjectHash<K> implements TObjectFloatMap <K>, Externalizable
| Modifier and Type | Class and Description |
|---|---|
protected class |
TObjectFloatHashMap
a view onto the keys of the map.
|
| Modifier and Type | Field and Description |
|---|---|
protected float[] |
_values
the values of the map
|
protected float |
no_entry_value
the value that represents null
|
_set, consumeFreeSlot, FREE, REMOVED_autoCompactionFactor, _autoCompactRemovesRemaining, _autoCompactTemporaryDisable, _free, _loadFactor, _maxSize, _size, DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR| Constructor and Description |
|---|
TObjectFloatHashMap()
Creates a new
TObjectFloatHashMap instance with the default capacity and load factor.
|
TObjectFloatHashMap(int initialCapacity)
Creates a new
TObjectFloatHashMap instance with a prime capacity equal to or greater than
initialCapacity and with the default load factor.
|
TObjectFloatHashMap(int initialCapacity, float loadFactor)
Creates a new
TObjectFloatHashMap instance with a prime capacity equal to or greater than
initialCapacity and with the specified load factor.
|
TObjectFloatHashMap(int initialCapacity, float loadFactor, float noEntryValue)
Creates a new
TObjectFloatHashMap instance with a prime value at or near the specified capacity and load factor.
|
TObjectFloatHashMap(TObjectFloatMap
Creates a new
TObjectFloatHashMap that contains the entries in the map passed to it.
|
| Modifier and Type | Method and Description |
|---|---|
float |
adjustOrPutValue(K key, float adjust_amount, float put_amount)
|
boolean |
adjustValue(K key, float amount)
|
void |
clear()
|
boolean |
containsKey(Object
|
boolean |
containsValue(float val)
|
boolean |
equals(Object
Compares this map with another map for equality of their stored entries.
|
boolean |
forEachEntry(TObjectFloatProcedure
Executes
procedure for each key/value entry in the map.
|
boolean |
forEachKey(TObjectProcedure
Executes
procedure for each key in the map.
|
boolean |
forEachValue(TFloatProcedure
Executes
procedure for each value in the map.
|
float |
get(Object
|
float |
getNoEntryValue()
|
int |
hashCode()
|
boolean |
increment(K key)
|
TObjectFloatIterator |
iterator()
|
Object |
keys()
|
K[] |
keys(K[] a)
|
Set |
keySet()
|
float |
put(K key, float value)
|
void |
putAll(Map
|
void |
putAll(TObjectFloatMap
|
float |
putIfAbsent(K key, float value)
|
void |
readExternal(ObjectInput
|
protected void |
rehash(int newCapacity)
rehashes the map to the new capacity.
|
float |
remove(Object
|
protected void |
removeAt(int index)
Removes the mapping at
index from the map.
|
boolean |
retainEntries(TObjectFloatProcedure
Retains only those entries in the map for which the procedure returns a true value.
|
int |
setUp(int initialCapacity)
initializes the hashtable to a prime capacity which is at least
initialCapacity + 1.
|
String |
toString()
|
void |
transformValues(TFloatFunction
Transform the values in this map using
function.
|
TFloatCollection |
valueCollection()
|
float[] |
values()
|
float[] |
values(float[] array)
|
void |
writeExternal(ObjectOutput
|
buildObjectContractViolation, capacity, contains, dumpExtraInfo, equals, forEach, hash, index, insertionIndex, insertKey, objectInfo, reportPotentialConcurrentMod, throwObjectContractViolation, throwObjectContractViolationcalculateGrownCapacity, compact, computeMaxSize, computeNextAutoCompactionAmount, ensureCapacity, fastCeil, getAutoCompactionFactor, isEmpty, postInsertHook, reenableAutoCompaction, saturatedCast, setAutoCompactionFactor, size, tempDisableAutoCompaction, trimToSizeclone, finalize, getClass, notify, notifyAll, wait, wait, waitisEmpty, sizeprotected transient float[] _values
protected float no_entry_value
public TObjectFloatHashMap()
TObjectFloatHashMap instance with the default capacity and load factor.
public TObjectFloatHashMap(int initialCapacity)
TObjectFloatHashMap instance with a prime capacity equal to or greater than
initialCapacity and with the default load factor.
initialCapacity - an
int value
public TObjectFloatHashMap(int initialCapacity,
float loadFactor)
TObjectFloatHashMap instance with a prime capacity equal to or greater than
initialCapacity and with the specified load factor.
initialCapacity - an
int value
loadFactor - a
float value
public TObjectFloatHashMap(int initialCapacity,
float loadFactor,
float noEntryValue)
TObjectFloatHashMap instance with a prime value at or near the specified capacity and load factor.
initialCapacity - used to find a prime capacity for the table.
loadFactor - used to calculate the threshold over which rehashing takes place.
noEntryValue - the value used to represent null.
public TObjectFloatHashMap(TObjectFloatMap<? extends K> map)
TObjectFloatHashMap that contains the entries in the map passed to it.
map - the
TObjectFloatMap to be copied.
public int setUp(int initialCapacity)
setUp in class
TObjectHash<K>
initialCapacity - an
int value
protected void rehash(int newCapacity)
public float getNoEntryValue()
public boolean containsKey(Objectkey)
public boolean containsValue(float val)
public float get(Objectkey)
public float put(K key, float value)
public float putIfAbsent(K key, float value)
public float remove(Objectkey)
protected void removeAt(int index)
removeAt in class
TObjectHash<K>
index - an
int value
public void putAll(TObjectFloatMap<? extends K> map)
public void clear()
public Object[] keys()
public TFloatCollectionvalueCollection()
public float[] values()
public float[] values(float[] array)
public TObjectFloatIterator<K> iterator()
iterator in interface
TObjectFloatMap<K>
public boolean increment(K key)
public boolean adjustValue(K key, float amount)
public float adjustOrPutValue(K key, float adjust_amount, float put_amount)
public boolean forEachKey(TObjectProcedure<? super K> procedure)
forEachKey in interface
TObjectFloatMap<K>
procedure - a
TObjectProcedure value
public boolean forEachValue(TFloatProcedureprocedure)
forEachValue in interface
TObjectFloatMap<K>
procedure - a
TFloatProcedure value
public boolean forEachEntry(TObjectFloatProcedure<? super K> procedure)
forEachEntry in interface
TObjectFloatMap<K>
procedure - a
TOObjectFloatProcedure value
public boolean retainEntries(TObjectFloatProcedure<? super K> procedure)
retainEntries in interface
TObjectFloatMap<K>
procedure - determines which entries to keep
public void transformValues(TFloatFunctionfunction)
transformValues in interface
TObjectFloatMap<K>
function - a
TFloatFunction value
public boolean equals(Objectother)
equals in interface
TObjectFloatMap<K>
equals in class
Object
other - an
Object value
boolean value
public int hashCode()
public void writeExternal(ObjectOutputout) throws IOException
writeExternal in interface
Externalizable
writeExternal in class
TObjectHash<K>
IOException
public void readExternal(ObjectInputin) throws IOException , ClassNotFoundException
readExternal in interface
Externalizable
readExternal in class
TObjectHash<K>
IOException
ClassNotFoundException
public StringtoString()