Class GridConcurrentLinkedHashSet<E>

    • Constructor Detail

      • GridConcurrentLinkedHashSet

        public GridConcurrentLinkedHashSet()
        Creates a new, empty set with a default initial capacity, load factor, and concurrencyLevel.
      • GridConcurrentLinkedHashSet

        public GridConcurrentLinkedHashSet​(int initCap)
        Creates a new, empty set with the specified initial capacity, and with default load factor and concurrencyLevel.
        Parameters:
        initCap - The initial capacity. The implementation performs internal sizing to accommodate this many elements.
        Throws:
        IllegalArgumentException - if the initial capacity of elements is negative.
      • GridConcurrentLinkedHashSet

        public GridConcurrentLinkedHashSet​(int initCap,
                                           float loadFactor,
                                           int conLevel)
        Creates a new, empty set with the specified initial capacity, load factor, and concurrency level.
        Parameters:
        initCap - 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.
        conLevel - The estimated number of concurrently updating threads. The implementation performs internal sizing to try to accommodate this many threads.
        Throws:
        IllegalArgumentException - if the initial capacity is negative or the load factor or concurrency level are non-positive.
      • GridConcurrentLinkedHashSet

        public GridConcurrentLinkedHashSet​(Collection<E> c)
        Creates a new set with the same elements as the given collection. The collection is created with a capacity of twice the number of mappings in the given map or 11 (whichever is greater), and a default load factor and concurrencyLevel.
        Parameters:
        c - Collection to add.
    • Method Detail

      • add

        public boolean add​(E e)
        Note that unlike regular add operation on a set, this method will only add the passed in element if it's not already present in set.
        Specified by:
        add in interface Collection<E>
        Specified by:
        add in interface Set<E>
        Overrides:
        add in class GridSetWrapper<E>
        Parameters:
        e - Element to add.
        Returns:
        True if element was added.
      • addx

        @Nullable
        public E addx​(E e)
        Note that unlike regular add operation on a set, this method will only add the passed in element if it's not already present in set.
        Parameters:
        e - Element to add.
        Returns:
        Value previously present in set or null if set didn't have this value.
      • descendingIterator

        public Iterator<E> descendingIterator()
        Returns:
        Descending iterator.