Package org.wildfly.naming.client.util
Class FastHashtable<K,V>
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<K,V>
-
- org.wildfly.naming.client.util.FastHashtable<K,V>
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<K,V>
public class FastHashtable<K,V> extends Hashtable<K,V>
A hashtable that is implemented in terms of a fast concurrent map instead of a slow synchronized hash table.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FastHashtable()FastHashtable(int initialCapacity)FastHashtable(int initialCapacity, float loadFactor)FastHashtable(Map<? extends K,? extends V> t)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()FastHashtable<K,V>clone()Vcompute(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)VcomputeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)VcomputeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)booleancontains(Object value)booleancontainsKey(Object key)booleancontainsValue(Object value)Enumeration<V>elements()Set<Map.Entry<K,V>>entrySet()booleanequals(Object o)voidforEach(BiConsumer<? super K,? super V> action)Vget(Object key)VgetOrDefault(Object key, V defaultValue)inthashCode()booleanisEmpty()Enumeration<K>keys()ConcurrentHashMap.KeySetView<K,V>keySet()ConcurrentHashMap.KeySetView<K,V>keySet(V mappedValue)longmappingCount()Vmerge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)static <K,V>
FastHashtable<K,V>of(Hashtable<K,V> other)Vput(K key, V value)voidputAll(Map<? extends K,? extends V> m)VputIfAbsent(K key, V value)protected voidrehash()Vremove(Object key)booleanremove(Object key, Object value)Vreplace(K key, V value)booleanreplace(K key, V oldValue, V newValue)voidreplaceAll(BiFunction<? super K,? super V,? extends V> function)intsize()StringtoString()Collection<V>values()
-
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<K,V>- Overrides:
containsKeyin classHashtable<K,V>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<K,V>- Overrides:
containsValuein classHashtable<K,V>
-
clear
public void clear()
-
keySet
public ConcurrentHashMap.KeySetView<K,V> keySet()
-
values
public Collection<V> values()
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object o)
-
putIfAbsent
public V putIfAbsent(K key, V value)
- Specified by:
putIfAbsentin interfaceMap<K,V>- Overrides:
putIfAbsentin classHashtable<K,V>
-
getOrDefault
public V getOrDefault(Object key, V defaultValue)
- Specified by:
getOrDefaultin interfaceMap<K,V>- Overrides:
getOrDefaultin classHashtable<K,V>
-
forEach
public void forEach(BiConsumer<? super K,? super V> action)
-
replaceAll
public void replaceAll(BiFunction<? super K,? super V,? extends V> function)
- Specified by:
replaceAllin interfaceMap<K,V>- Overrides:
replaceAllin classHashtable<K,V>
-
computeIfAbsent
public V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
- Specified by:
computeIfAbsentin interfaceMap<K,V>- Overrides:
computeIfAbsentin classHashtable<K,V>
-
computeIfPresent
public V computeIfPresent(K key, BiFunction<? super K,? super V,? extends V> remappingFunction)
- Specified by:
computeIfPresentin interfaceMap<K,V>- Overrides:
computeIfPresentin classHashtable<K,V>
-
merge
public V merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
-
mappingCount
public long mappingCount()
-
keySet
public ConcurrentHashMap.KeySetView<K,V> keySet(V mappedValue)
-
of
public static <K,V> FastHashtable<K,V> of(Hashtable<K,V> other)
-
-