Package com.mycila.xmltool
Class SoftHashMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
com.mycila.xmltool.SoftHashMap<K,V>
- All Implemented Interfaces:
Map<K,
V>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private class
private class
private class
private class
private class
private static class
private class
private class
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleImmutableEntry<K,
V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final float
private final float
private static final int
private int
private static final Object
private final ReferenceQueue
<K> private int
private SoftHashMap.Entry<K,
V>[] private int
private Collection
<V> -
Constructor Summary
ConstructorsConstructorDescriptionSoftHashMap
(int initialCapacity) SoftHashMap
(int initialCapacity, float loadFactor) SoftHashMap
(Map<? extends K, ? extends V> t) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) private boolean
boolean
containsValue
(Object value) entrySet()
private static boolean
private void
private SoftHashMap.Entry
<K, V> private SoftHashMap.Entry<K,
V>[] getTable()
private static int
hash
(int h) private static int
private static int
indexFor
(int h, int length) boolean
isEmpty()
keySet()
private static <K> K
void
private SoftHashMap.Entry
<K, V> private void
resize
(int newCapacity) int
size()
private void
transfer
(SoftHashMap.Entry<K, V>[] src, SoftHashMap.Entry<K, V>[] dest) private static <K> K
unmaskNull
(Object key) values()
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
DEFAULT_INITIAL_CAPACITY
private static final int DEFAULT_INITIAL_CAPACITY- See Also:
-
MAXIMUM_CAPACITY
private static final int MAXIMUM_CAPACITY- See Also:
-
DEFAULT_LOAD_FACTOR
private static final float DEFAULT_LOAD_FACTOR- See Also:
-
NULL_KEY
-
table
-
size
private int size -
threshold
private int threshold -
loadFactor
private final float loadFactor -
queue
-
modCount
private volatile int modCount -
entrySet
-
keySet
-
values
-
-
Constructor Details
-
SoftHashMap
public SoftHashMap(int initialCapacity, float loadFactor) -
SoftHashMap
public SoftHashMap(int initialCapacity) -
SoftHashMap
public SoftHashMap() -
SoftHashMap
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
get
-
put
-
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V> - Overrides:
containsKey
in classAbstractMap<K,
V>
-
putAll
-
remove
-
clear
public void clear() -
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V> - Overrides:
containsValue
in classAbstractMap<K,
V>
-
keySet
-
values
-
entrySet
-
expungeStaleEntries
private void expungeStaleEntries() -
getTable
-
getEntry
-
resize
private void resize(int newCapacity) -
transfer
-
removeMapping
-
containsNullValue
private boolean containsNullValue() -
maskNull
-
unmaskNull
-
eq
-
indexFor
private static int indexFor(int h, int length) -
hash
-
hash
private static int hash(int h)
-