Class OpenHashSet<T>

java.lang.Object
rx.internal.util.OpenHashSet<T>
Type Parameters:
T - the element type

public final class OpenHashSet<T> extends Object
A simple open hash set with add, remove and clear capabilities only.

Doesn't support nor checks for nulls.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final int
     
    (package private) T[]
     
    (package private) final float
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    OpenHashSet(int capacity)
    Creates an OpenHashSet with the initial capacity and load factor of 0.75f.
    OpenHashSet(int capacity, float loadFactor)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(T value)
     
    void
    clear(Action1<? super T> clearAction)
     
    boolean
     
    (package private) static int
    mix(int x)
     
    (package private) void
     
    boolean
    remove(T value)
     
    (package private) boolean
    removeEntry(int pos, T[] a, int m)
     
    void
     
    T[]
    Returns the raw array of values of this set, watch out for null entires.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • loadFactor

      final float loadFactor
    • mask

      int mask
    • size

      int size
    • maxSize

      int maxSize
    • keys

      T[] keys
    • INT_PHI

      private static final int INT_PHI
      See Also:
  • Constructor Details

    • OpenHashSet

      public OpenHashSet()
    • OpenHashSet

      public OpenHashSet(int capacity)
      Creates an OpenHashSet with the initial capacity and load factor of 0.75f.
      Parameters:
      capacity - the initial capacity
    • OpenHashSet

      public OpenHashSet(int capacity, float loadFactor)
  • Method Details

    • add

      public boolean add(T value)
    • remove

      public boolean remove(T value)
    • removeEntry

      boolean removeEntry(int pos, T[] a, int m)
    • clear

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

      public void terminate()
    • rehash

      void rehash()
    • mix

      static int mix(int x)
    • isEmpty

      public boolean isEmpty()
    • values

      public T[] values()
      Returns the raw array of values of this set, watch out for null entires.
      Returns:
      the raw array of values of this set