Class CompactHashSet<E>

    • Field Detail

      • nullObject

        protected static final Object nullObject
        This object is used to represent null, should clients add that to the set.
      • deletedObject

        protected static final Object deletedObject
        When an object is deleted this object is put into the hashtable in its place, so that other objects with the same key (collisions) further down the hashtable are not lost after we delete an object in the collision chain.
      • elements

        protected int elements
      • freecells

        protected int freecells
        This is the number of empty (null) cells. It's not necessarily the same as objects.length - elements, because some cells may contain deletedObject.
      • objects

        protected E[] objects
      • modCount

        protected int modCount
    • Constructor Detail

      • CompactHashSet

        public CompactHashSet()
        Constructs a new, empty set.
      • CompactHashSet

        public CompactHashSet​(int size)
        Constructs a new, empty set.
      • CompactHashSet

        public CompactHashSet​(Collection<E> c)
        Constructs a new set containing the elements in the specified collection.
        Parameters:
        c - the collection whose elements are to be placed into this set.