public class TObjectCharHashMap<K> extends TObjectHash<K> implements TObjectCharMap <K>, Externalizable
| Modifier and Type | Class and Description |
|---|---|
protected class |
TObjectCharHashMap
a view onto the keys of the map.
|
| Modifier and Type | Field and Description |
|---|---|
protected char[] |
_values
the values of the map
|
protected char |
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 |
|---|
TObjectCharHashMap()
Creates a new
TObjectCharHashMap instance with the default capacity and load factor.
|
TObjectCharHashMap(int initialCapacity)
Creates a new
TObjectCharHashMap instance with a prime capacity equal to or greater than
initialCapacity and with the default load factor.
|
TObjectCharHashMap(int initialCapacity, float loadFactor)
Creates a new
TObjectCharHashMap instance with a prime capacity equal to or greater than
initialCapacity and with the specified load factor.
|
TObjectCharHashMap(int initialCapacity, float loadFactor, char noEntryValue)
Creates a new
TObjectCharHashMap instance with a prime value at or near the specified capacity and load factor.
|
TObjectCharHashMap(TObjectCharMap
Creates a new
TObjectCharHashMap that contains the entries in the map passed to it.
|
| Modifier and Type | Method and Description |
|---|---|
char |
adjustOrPutValue(K key, char adjust_amount, char put_amount)
|
boolean |
adjustValue(K key, char amount)
|
void |
clear()
|
boolean |
containsKey(Object
|
boolean |
containsValue(char val)
|
boolean |
equals(Object
Compares this map with another map for equality of their stored entries.
|
boolean |
forEachEntry(TObjectCharProcedure
Executes
procedure for each key/value entry in the map.
|
boolean |
forEachKey(TObjectProcedure
Executes
procedure for each key in the map.
|
boolean |
forEachValue(TCharProcedure
Executes
procedure for each value in the map.
|
char |
get(Object
|
char |
getNoEntryValue()
|
int |
hashCode()
|
boolean |
increment(K key)
|
TObjectCharIterator |
iterator()
|
Object |
keys()
|
K[] |
keys(K[] a)
|
Set |
keySet()
|
char |
put(K key, char value)
|
void |
putAll(Map
|
void |
putAll(TObjectCharMap
|
char |
putIfAbsent(K key, char value)
|
void |
readExternal(ObjectInput
|
protected void |
rehash(int newCapacity)
rehashes the map to the new capacity.
|
char |
remove(Object
|
protected void |
removeAt(int index)
Removes the mapping at
index from the map.
|
boolean |
retainEntries(TObjectCharProcedure
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(TCharFunction
Transform the values in this map using
function.
|
TCharCollection |
valueCollection()
|
char[] |
values()
|
char[] |
values(char[] array)
|
void |
writeExternal(ObjectOutput
|
buildObjectContractViolation, capacity, contains, dumpExtraInfo, equals, forEach, hash, index, insertionIndex, insertKey, objectInfo, reportPotentialConcurrentMod, throwObjectContractViolation, throwObjectContractViolationcalculateGrownCapacity, compact, computeMaxSize, computeNextAutoCompactionAmount, ensureCapacity, getAutoCompactionFactor, isEmpty, postInsertHook, reenableAutoCompaction, setAutoCompactionFactor, size, tempDisableAutoCompaction, trimToSizeclone, finalize, getClass, notify, notifyAll, wait, wait, waitisEmpty, sizeprotected transient char[] _values
protected char no_entry_value
public TObjectCharHashMap()
TObjectCharHashMap instance with the default capacity and load factor.
public TObjectCharHashMap(int initialCapacity)
TObjectCharHashMap instance with a prime capacity equal to or greater than
initialCapacity and with the default load factor.
initialCapacity - an
int value
public TObjectCharHashMap(int initialCapacity,
float loadFactor)
TObjectCharHashMap 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 TObjectCharHashMap(int initialCapacity,
float loadFactor,
char noEntryValue)
TObjectCharHashMap 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 TObjectCharHashMap(TObjectCharMap<? extends K> map)
TObjectCharHashMap that contains the entries in the map passed to it.
map - the
TObjectCharMap to be copied.
public int setUp(int initialCapacity)
setUp in class
TObjectHash<K>
initialCapacity - an
int value
protected void rehash(int newCapacity)
public char getNoEntryValue()
public boolean containsKey(Objectkey)
public boolean containsValue(char val)
public char get(Objectkey)
public char put(K key, char value)
public char putIfAbsent(K key, char value)
public char remove(Objectkey)
protected void removeAt(int index)
removeAt in class
TObjectHash<K>
index - an
int value
public void putAll(TObjectCharMap<? extends K> map)
public void clear()
public Object[] keys()
public TCharCollectionvalueCollection()
public char[] values()
public char[] values(char[] array)
public TObjectCharIterator<K> iterator()
iterator in interface
TObjectCharMap<K>
public boolean increment(K key)
public boolean adjustValue(K key, char amount)
public char adjustOrPutValue(K key, char adjust_amount, char put_amount)
public boolean forEachKey(TObjectProcedure<? super K> procedure)
forEachKey in interface
TObjectCharMap<K>
procedure - a
TObjectProcedure value
public boolean forEachValue(TCharProcedureprocedure)
forEachValue in interface
TObjectCharMap<K>
procedure - a
TCharProcedure value
public boolean forEachEntry(TObjectCharProcedure<? super K> procedure)
forEachEntry in interface
TObjectCharMap<K>
procedure - a
TOObjectCharProcedure value
public boolean retainEntries(TObjectCharProcedure<? super K> procedure)
retainEntries in interface
TObjectCharMap<K>
procedure - determines which entries to keep
public void transformValues(TCharFunctionfunction)
transformValues in interface
TObjectCharMap<K>
function - a
TCharFunction value
public boolean equals(Objectother)
equals in interface
TObjectCharMap<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()