org.jikesrvm.util
Class AbstractHashSetRVM<T>
java.lang.Object
org.jikesrvm.util.AbstractHashSetRVM<T>
- All Implemented Interfaces:
- Iterable<T>
- Direct Known Subclasses:
- HashSetRVM, ImmutableEntryHashSetRVM
abstract class AbstractHashSetRVM<T>
- extends Object
- implements Iterable<T>
Common super class for all VM hash sets.
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 AbstractHashSetRVM.AbstractBucket<T>[] buckets
numElems
protected int numElems
AbstractHashSetRVM
AbstractHashSetRVM(int size)
createNewBucket
abstract AbstractHashSetRVM.AbstractBucket<T> createNewBucket(T key,
AbstractHashSetRVM.AbstractBucket<T> next)
newBucketArray
protected AbstractHashSetRVM.AbstractBucket<T>[] newBucketArray(int size)
size
public int size()
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
add
public void add(T key)
get
public T get(T key)
contains
public boolean contains(T key)
addAll
public void addAll(AbstractHashSetRVM<T> c)
growMap
private void growMap()
remove
public void remove(T key)
removeAll
public void removeAll()
iterator
public Iterator<T> iterator()
- Specified by:
iterator
in interface Iterable<T>
bucketIndex
private int bucketIndex(T key,
int divisor)