public class OpenHashSet<E>
extends java.util.AbstractSet<E>
| Modifier and Type | Class and Description |
|---|---|
private static class |
OpenHashSet.Iter<E> |
| Modifier and Type | Field and Description |
|---|---|
private E[] |
buffer |
private int |
resizeThreshold |
private int |
size |
| Constructor and Description |
|---|
OpenHashSet(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E newVal) |
private void |
addForResize(E[] buffer,
int mask,
E newVal) |
private boolean |
addSlowPath(E[] buffer,
int mask,
E newVal,
int hash) |
private void |
compactAndRemove(E[] buffer,
int mask,
int removeHashIndex) |
boolean |
contains(java.lang.Object needle) |
private boolean |
containsSlowPath(E[] buffer,
int mask,
int hash,
java.lang.Object needle) |
java.util.Iterator<E> |
iterator() |
private int |
rehash(int h) |
boolean |
remove(java.lang.Object val) |
private boolean |
removeSlowPath(java.lang.Object val,
E[] buffer,
int mask,
int hash) |
private void |
resize() |
int |
size() |
addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitprivate int size
private E[] buffer
private int resizeThreshold
public int size()
public boolean add(E newVal)
private void resize()
public boolean remove(java.lang.Object val)
private boolean removeSlowPath(java.lang.Object val,
E[] buffer,
int mask,
int hash)
private void compactAndRemove(E[] buffer, int mask, int removeHashIndex)
private int rehash(int h)
public boolean contains(java.lang.Object needle)
private boolean containsSlowPath(E[] buffer, int mask, int hash, java.lang.Object needle)