Package gw.util
Class CiHashMap<K extends java.lang.CharSequence,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- gw.util.CiHashMap<K,V>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<K,V>
public class CiHashMap<K extends java.lang.CharSequence,V> extends java.util.AbstractMap<K,V> implements java.util.Map<K,V>, java.lang.Cloneable, java.io.Serializable- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classCiHashMap.Entry<K extends java.lang.CharSequence,V>private classCiHashMap.EntryIterator<E>private classCiHashMap.EntrySetprivate classCiHashMap.KeyIteratorprivate classCiHashMap.KeySetprivate classCiHashMap.MapEntryIteratorprivate classCiHashMap.ValuesCollectionprivate classCiHashMap.ValuesIterator
-
Field Summary
Fields Modifier and Type Field Description private float_loadFactorprivate int_modCountprivate int_resizeThresholdprivate int_sizeprivate CiHashMap.Entry<K,V>[]_tableprivate static intDEFAULT_INITIAL_CAPACITYprivate static floatDEFAULT_LOAD_FACTORprivate static intMAX_TABLE_SIZEprivate static intNULL_KEY_HASH_CODE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private intbucketNumber(int hashCode)private intbucketNumber(int hashCode, int tableLength)voidclear()java.lang.Objectclone()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)private booleanentryMatches(java.lang.Object key, int hash, CiHashMap.Entry<K,V> entry)java.util.Set<java.util.Map.Entry<K,V>>entrySet()private CiHashMap.Entry<K,V>findEntry(java.lang.Object key, int hash)private intfindNearestPowerOfTwo(int i)Vget(java.lang.Object key)private static inthash(java.lang.Object x)java.util.Set<K>keySet()private static booleankeysMatch(java.lang.Object x, java.lang.Object y)Vput(K key, V value)voidputAll(java.util.Map<? extends K,? extends V> m)private voidputAllImpl(java.util.Map<? extends K,? extends V> map, boolean resizeIfNecessary)private VputImpl(K key, V value, boolean resizeIfNecessary)Vremove(java.lang.Object key)private CiHashMap.Entry<K,V>removeEntry(java.lang.Object key)private voidresize(int newCapacity)intsize()java.util.Collection<V>values()
-
-
-
Field Detail
-
NULL_KEY_HASH_CODE
private static final int NULL_KEY_HASH_CODE
- See Also:
- Constant Field Values
-
DEFAULT_INITIAL_CAPACITY
private static final int DEFAULT_INITIAL_CAPACITY
- See Also:
- Constant Field Values
-
DEFAULT_LOAD_FACTOR
private static final float DEFAULT_LOAD_FACTOR
- See Also:
- Constant Field Values
-
MAX_TABLE_SIZE
private static final int MAX_TABLE_SIZE
- See Also:
- Constant Field Values
-
_size
private int _size
-
_table
private CiHashMap.Entry<K extends java.lang.CharSequence,V>[] _table
-
_resizeThreshold
private int _resizeThreshold
-
_loadFactor
private float _loadFactor
-
_modCount
private int _modCount
-
-
Method Detail
-
findNearestPowerOfTwo
private int findNearestPowerOfTwo(int i)
-
size
public int size()
-
get
public V get(java.lang.Object key)
-
containsKey
public boolean containsKey(java.lang.Object key)
-
findEntry
private CiHashMap.Entry<K,V> findEntry(java.lang.Object key, int hash)
-
entryMatches
private boolean entryMatches(java.lang.Object key, int hash, CiHashMap.Entry<K,V> entry)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
putAllImpl
private void putAllImpl(java.util.Map<? extends K,? extends V> map, boolean resizeIfNecessary)
-
remove
public V remove(java.lang.Object key)
-
removeEntry
private CiHashMap.Entry<K,V> removeEntry(java.lang.Object key)
-
clear
public void clear()
-
clone
public java.lang.Object clone()
-
keySet
public java.util.Set<K> keySet()
-
values
public java.util.Collection<V> values()
-
keysMatch
private static boolean keysMatch(java.lang.Object x, java.lang.Object y)
-
hash
private static int hash(java.lang.Object x)
-
bucketNumber
private int bucketNumber(int hashCode)
-
bucketNumber
private int bucketNumber(int hashCode, int tableLength)
-
resize
private void resize(int newCapacity)
-
-