Package gw.util
Class CiHashMap<K extends CharSequence,V>
java.lang.Object
java.util.AbstractMap<K,V>
gw.util.CiHashMap<K,V>
- All Implemented Interfaces:
Serializable,Cloneable,Map<K,V>
public class CiHashMap<K extends CharSequence,V>
extends AbstractMap<K,V>
implements Map<K,V>, Cloneable, Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classCiHashMap.Entry<K extends CharSequence,V> private classprivate classprivate classprivate classprivate classprivate classprivate classNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate intprivate intprivate intprivate CiHashMap.Entry<K,V>[] private static final intprivate static final floatprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intbucketNumber(int hashCode) private intbucketNumber(int hashCode, int tableLength) voidclear()clone()booleancontainsKey(Object key) booleancontainsValue(Object value) private booleanentryMatches(Object key, int hash, CiHashMap.Entry<K, V> entry) entrySet()private CiHashMap.Entry<K,V> private intfindNearestPowerOfTwo(int i) private static intkeySet()private static booleanvoidprivate voidputAllImpl(Map<? extends K, ? extends V> map, boolean resizeIfNecessary) private Vprivate CiHashMap.Entry<K,V> removeEntry(Object key) private voidresize(int newCapacity) intsize()values()Methods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, isEmpty, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
NULL_KEY_HASH_CODE
private static final int NULL_KEY_HASH_CODE- See Also:
-
DEFAULT_INITIAL_CAPACITY
private static final int DEFAULT_INITIAL_CAPACITY- See Also:
-
DEFAULT_LOAD_FACTOR
private static final float DEFAULT_LOAD_FACTOR- See Also:
-
MAX_TABLE_SIZE
private static final int MAX_TABLE_SIZE- See Also:
-
_size
private int _size -
_table
-
_resizeThreshold
private int _resizeThreshold -
_loadFactor
private float _loadFactor -
_modCount
private int _modCount
-
-
Constructor Details
-
CiHashMap
public CiHashMap() -
CiHashMap
public CiHashMap(int initialCapacity) -
CiHashMap
public CiHashMap(int initialCapacity, float loadFactor) -
CiHashMap
-
-
Method Details
-
findNearestPowerOfTwo
private int findNearestPowerOfTwo(int i) -
size
public int size()- Specified by:
sizein interfaceMap<K extends CharSequence,V> - Overrides:
sizein classAbstractMap<K extends CharSequence,V>
-
get
- Specified by:
getin interfaceMap<K extends CharSequence,V> - Overrides:
getin classAbstractMap<K extends CharSequence,V>
-
containsKey
- Specified by:
containsKeyin interfaceMap<K extends CharSequence,V> - Overrides:
containsKeyin classAbstractMap<K extends CharSequence,V>
-
findEntry
-
entryMatches
-
containsValue
- Specified by:
containsValuein interfaceMap<K extends CharSequence,V> - Overrides:
containsValuein classAbstractMap<K extends CharSequence,V>
-
put
- Specified by:
putin interfaceMap<K extends CharSequence,V> - Overrides:
putin classAbstractMap<K extends CharSequence,V>
-
putImpl
-
putAll
- Specified by:
putAllin interfaceMap<K extends CharSequence,V> - Overrides:
putAllin classAbstractMap<K extends CharSequence,V>
-
putAllImpl
-
remove
- Specified by:
removein interfaceMap<K extends CharSequence,V> - Overrides:
removein classAbstractMap<K extends CharSequence,V>
-
removeEntry
-
clear
public void clear()- Specified by:
clearin interfaceMap<K extends CharSequence,V> - Overrides:
clearin classAbstractMap<K extends CharSequence,V>
-
clone
- Overrides:
clonein classAbstractMap<K extends CharSequence,V>
-
keySet
- Specified by:
keySetin interfaceMap<K extends CharSequence,V> - Overrides:
keySetin classAbstractMap<K extends CharSequence,V>
-
entrySet
- Specified by:
entrySetin interfaceMap<K extends CharSequence,V> - Specified by:
entrySetin classAbstractMap<K extends CharSequence,V>
-
values
- Specified by:
valuesin interfaceMap<K extends CharSequence,V> - Overrides:
valuesin classAbstractMap<K extends CharSequence,V>
-
keysMatch
-
hash
-
bucketNumber
private int bucketNumber(int hashCode) -
bucketNumber
private int bucketNumber(int hashCode, int tableLength) -
resize
private void resize(int newCapacity)
-