Package org.jruby.util
Class WeakIdentityHashMap
java.lang.Object
org.jruby.util.GenericMap
org.jruby.util.WeakIdentityHashMap
- All Implemented Interfaces:
Map
Class
WeakIdentityHashMap is a hash map that hashes
objects based on System.identityHashMap, and holds weakly onto the
key. This fails if values make reference to the keys!- Since:
- 1.0
- Version:
- 2.0
- Author:
- Kresten Krab Thorup
-
Field Summary
Fields inherited from class org.jruby.util.GenericMap
size -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) return the element with the given keyprotected Iteratorreturn the element with the given keybooleanisEmpty()protected final booleanprotected final intintsize()protected voidvalueRemoved(Object value) Methods inherited from class org.jruby.util.GenericMap
containsValue, entrySet, equals, hashCode, keyIterator, keySet, putAll, valueEquals, valueHash, valueIterator, valuesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, values
-
Constructor Details
-
WeakIdentityHashMap
public WeakIdentityHashMap()the default and only constructor -
WeakIdentityHashMap
public WeakIdentityHashMap(int size)
-
-
Method Details
-
clear
public void clear() -
get
return the element with the given key -
containsKey
return the element with the given key- Specified by:
containsKeyin interfaceMap- Overrides:
containsKeyin classGenericMap
-
put
-
remove
-
remove
-
valueRemoved
-
entryIterator
- Specified by:
entryIteratorin classGenericMap
-
keyHash
- Overrides:
keyHashin classGenericMap
-
keyEquals
- Overrides:
keyEqualsin classGenericMap
-
size
public int size()- Specified by:
sizein interfaceMap- Overrides:
sizein classGenericMap
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceMap- Overrides:
isEmptyin classGenericMap
-