org.jikesrvm.util
Class AbstractHashMapRVM<K,V>
java.lang.Object
org.jikesrvm.util.AbstractHashMapRVM<K,V>
- Direct Known Subclasses:
- HashMapRVM, IdentityHashMapRVM, ImmutableEntryHashMapRVM, ImmutableEntryIdentityHashMapRVM
abstract class AbstractHashMapRVM<K,V>
- extends Object
Common super class for all VM hash maps.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_SIZE
protected static final int DEFAULT_SIZE
- See Also:
- Constant Field Values
LOAD
private static final float LOAD
- See Also:
- Constant Field Values
buckets
protected AbstractHashMapRVM.AbstractBucket<K,V>[] buckets
numElems
protected int numElems
AbstractHashMapRVM
AbstractHashMapRVM(int size)
same
abstract boolean same(K key1,
K key2)
- Are two keys the same?
hashTheKey
abstract int hashTheKey(K key)
createNewBucket
abstract AbstractHashMapRVM.AbstractBucket<K,V> createNewBucket(K k,
V v,
AbstractHashMapRVM.AbstractBucket<K,V> n)
size
public final int size()
get
public final V get(K key)
growMapAllowed
private boolean growMapAllowed()
- Advise against growing the buckets if they are immortal, as it will lead
to multiple sets of buckets that will be scanned
put
public final V put(K key,
V value)
newBucketArray
private AbstractHashMapRVM.AbstractBucket<K,V>[] newBucketArray(int size)
growMap
private void growMap()
remove
public V remove(K key)
valueIterator
public final Iterator<V> valueIterator()
keyIterator
public final Iterator<K> keyIterator()
bucketIndex
private int bucketIndex(K key,
int divisor)
values
public final Iterable<V> values()
- Returns:
- a java.lang.Iterable for the values in the hash map
keys
public final Iterable<K> keys()
- Returns:
- a java.lang.Iterable for the values in the hash map