Package org.jctools.sets
Class IdentityOpenHashSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- org.jctools.sets.IdentityOpenHashSet<E>
-
- All Implemented Interfaces:
java.lang.Iterable<E>,java.util.Collection<E>,java.util.Set<E>
public class IdentityOpenHashSet<E> extends java.util.AbstractSet<E>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classIdentityOpenHashSet.Iter<E>
-
Field Summary
Fields Modifier and Type Field Description private E[]bufferprivate intresizeThresholdprivate intsize
-
Constructor Summary
Constructors Constructor Description IdentityOpenHashSet(int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E newVal)private voidaddForResize(E[] buffer, int mask, E newVal)private booleanaddSlowPath(E[] buffer, int mask, E newVal, int hash)private voidcompactAndRemove(E[] buffer, int mask, int removeHashIndex)booleancontains(java.lang.Object needle)private booleancontainsSlowPath(E[] buffer, int mask, int hash, java.lang.Object needle)java.util.Iterator<E>iterator()booleanremove(java.lang.Object val)private booleanremoveSlowPath(java.lang.Object val, E[] buffer, int mask, int hash)private voidresize()intsize()-
Methods inherited from class java.util.AbstractCollection
addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray, toString
-
-
-
-
Field Detail
-
size
private int size
-
buffer
private E[] buffer
-
resizeThreshold
private int resizeThreshold
-
-
Method Detail
-
size
public int size()
-
add
public boolean add(E newVal)
-
resize
private void resize()
-
remove
public boolean remove(java.lang.Object val)
-
removeSlowPath
private boolean removeSlowPath(java.lang.Object val, E[] buffer, int mask, int hash)
-
compactAndRemove
private void compactAndRemove(E[] buffer, int mask, int removeHashIndex)
-
contains
public boolean contains(java.lang.Object needle)
-
containsSlowPath
private boolean containsSlowPath(E[] buffer, int mask, int hash, java.lang.Object needle)
-
-