public class WeakIdentityHashMap extends GenericMap implements Map
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!size
Constructor and Description |
---|
WeakIdentityHashMap()
the default and only constructor
|
WeakIdentityHashMap(int size) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key)
return the element with the given key
|
protected Iterator |
entryIterator() |
Object |
get(Object key)
return the element with the given key
|
boolean |
isEmpty() |
protected boolean |
keyEquals(Object key1,
Object key2) |
protected int |
keyHash(Object key) |
Object |
put(Object key,
Object value) |
Object |
remove(int hash,
Object key) |
Object |
remove(Object key) |
int |
size() |
protected void |
valueRemoved(Object value) |
containsValue, entrySet, equals, hashCode, keyIterator, keySet, putAll, valueEquals, valueHash, valueIterator, values
public WeakIdentityHashMap()
public WeakIdentityHashMap(int size)
public boolean containsKey(Object key)
containsKey
in interface Map
containsKey
in class GenericMap
protected void valueRemoved(Object value)
protected Iterator entryIterator()
entryIterator
in class GenericMap
protected final int keyHash(Object key)
keyHash
in class GenericMap
protected final boolean keyEquals(Object key1, Object key2)
keyEquals
in class GenericMap
public int size()
size
in interface Map
size
in class GenericMap
public boolean isEmpty()
isEmpty
in interface Map
isEmpty
in class GenericMap
Copyright © 2001-2013 JRuby. All Rights Reserved.