Class FastCopyHashSet<E>

  • Type Parameters:
    E - the element type
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>

    public class FastCopyHashSet<E>
    extends MapDelegateSet<E>
    implements java.io.Serializable
    Concurrent Set based on top of FastCopyHashMap. It's serializable if the elements are serializable.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID
      The serialVersionUID
    • Constructor Summary

      Constructors 
      Constructor Description
      FastCopyHashSet()
      Constructs a new, empty set; the backing FastCopyHashMap instance has default initial capacity (16) and load factor (0.75).
      FastCopyHashSet​(int initialCapacity)
      Constructs a new, empty set; the backing FastCopyHashMap instance has the specified initial capacity and default load factor, which is 0.75.
      FastCopyHashSet​(int initialCapacity, float loadFactor)
      Constructs a new, empty set; the backing FastCopyHashMap instance has the specified initial capacity and the specified load factor.
      FastCopyHashSet​(java.util.Collection<? extends E> c)
      Constructs a new set containing the elements in the specified collection.
    • Method Summary

      • Methods inherited from class java.util.AbstractSet

        equals, hashCode, removeAll
      • Methods inherited from class java.util.AbstractCollection

        addAll, containsAll, retainAll, toArray, toArray
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        addAll, containsAll, retainAll, spliterator, toArray, toArray
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        The serialVersionUID
        See Also:
        Constant Field Values
    • Constructor Detail

      • FastCopyHashSet

        public FastCopyHashSet()
        Constructs a new, empty set; the backing FastCopyHashMap instance has default initial capacity (16) and load factor (0.75).
      • FastCopyHashSet

        public FastCopyHashSet​(java.util.Collection<? extends E> c)
        Constructs a new set containing the elements in the specified collection. The FastCopyHashMap is created with default load factor (0.75) and an initial capacity sufficient to contain the elements in the specified collection.
        Parameters:
        c - the collection whose elements are to be placed into this set.
        Throws:
        java.lang.NullPointerException - if the specified collection is null.
      • FastCopyHashSet

        public FastCopyHashSet​(int initialCapacity,
                               float loadFactor)
        Constructs a new, empty set; the backing FastCopyHashMap instance has the specified initial capacity and the specified load factor.
        Parameters:
        initialCapacity - the initial capacity. The implementation performs internal sizing to accommodate this many elements.
        loadFactor - the load factor threshold, used to control resizing. Resizing may be performed when the average number of elements per bin exceeds this threshold.
        Throws:
        java.lang.IllegalArgumentException - if the initial capacity is less than zero, or if the load factor is nonpositive.
      • FastCopyHashSet

        public FastCopyHashSet​(int initialCapacity)
        Constructs a new, empty set; the backing FastCopyHashMap instance has the specified initial capacity and default load factor, which is 0.75.
        Parameters:
        initialCapacity - the initial capacity of the hash table.
        Throws:
        java.lang.IllegalArgumentException - if the initial capacity is less than zero.