Top Description Fields Constructors Methods
rx.internal.util

public final Class OpenHashSet<T>

extends Object
Class Inheritance
Type Parameters
<T>
the element type
Imports
java.util.Arrays, rx.functions.Action1, rx.internal.util.unsafe.Pow2

A simple open hash set with add, remove and clear capabilities only.

Doesn't support nor checks for nulls.

Field Summary

Modifier and TypeField and Description
private static final int
pack-priv T[]
pack-priv final float
pack-priv int
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
public
public
OpenHashSet(int
the initial capacity
capacity
)

Creates an OpenHashSet with the initial capacity and load factor of 0.75f.

public
OpenHashSet(int capacity, float loadFactor)

Method Summary

Modifier and TypeMethod and Description
public boolean
add(T value)

public void
clear(Action1<? super T> clearAction)

public boolean
pack-priv static int
mix(int x)

pack-priv void
public boolean
remove(T value)

pack-priv boolean
removeEntry(int pos, T[] a, int m)

public void
public T[]

Returns:

the raw array of values of this set
values
()

Returns the raw array of values of this set, watch out for null entries.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INT_PHIback to summary
private static final int INT_PHI
keysback to summary
pack-priv T[] keys
loadFactorback to summary
pack-priv final float loadFactor
maskback to summary
pack-priv int mask
maxSizeback to summary
pack-priv int maxSize
sizeback to summary
pack-priv int size

Constructor Detail

OpenHashSetback to summary
public OpenHashSet()
OpenHashSetback to summary
public OpenHashSet(int capacity)

Creates an OpenHashSet with the initial capacity and load factor of 0.75f.

Parameters
capacity:int

the initial capacity

OpenHashSetback to summary
public OpenHashSet(int capacity, float loadFactor)
Annotations
@SuppressWarnings:unchecked

Method Detail

addback to summary
public boolean add(T value)
clearback to summary
public void clear(Action1<? super T> clearAction)
isEmptyback to summary
public boolean isEmpty()
mixback to summary
pack-priv static int mix(int x)
rehashback to summary
pack-priv void rehash()
Annotations
@SuppressWarnings:unchecked
removeback to summary
public boolean remove(T value)
removeEntryback to summary
pack-priv boolean removeEntry(int pos, T[] a, int m)
terminateback to summary
public void terminate()
Annotations
@SuppressWarnings:unchecked
valuesback to summary
public T[] values()

Returns the raw array of values of this set, watch out for null entries.

Returns:T[]

the raw array of values of this set