org.apache.ignite.internal.util.collection

## Class BitSetIntSet

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - org.apache.ignite.internal.util.GridSerializableCollection<Integer>
    - - org.apache.ignite.internal.util.collection.BitSetIntSet

All Implemented Interfaces:
  Serializable, Iterable<Integer>, Collection<Integer>, Set<Integer>, IntSet

    public class BitSetIntSet
    extends GridSerializableCollection<Integer>
    implements IntSet

Set of Integers implementation based on BitSet. Implementation doesn't support negative values and null, cause we can't distinct null from 0 bit in BitSet.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`BitSetIntSet()`
`BitSetIntSet(int initCap)`
`BitSetIntSet(int initCap, Collection<Integer> coll)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `add(int element)` Adds the specified element to this set.
`boolean` `add(Integer integer)`
`boolean` `addAll(@NotNull Collection<? extends Integer> c)`
`void` `clear()`
`boolean` `contains(int element)` Returns `true` if this set contains the specified element.
`boolean` `contains(Object o)`
`boolean` `containsAll(@NotNull Collection<?> c)`
`@NotNull Iterator<Integer>` `iterator()`
`boolean` `remove(int element)` Removes the specified element from this set.
`boolean` `remove(Object o)`
`boolean` `removeAll(@NotNull Collection<?> c)`
`boolean` `retainAll(@NotNull Collection<?> c)` Unsupported operation.
`int` `size()`
`int[]` `toIntArray()` Returns array with primitive types

### Methods inherited from class java.util.AbstractCollection

`isEmpty, toArray, toArray, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.util.Set

`equals, hashCode, isEmpty, spliterator, toArray, toArray`

### Methods inherited from interface java.util.Collection

`parallelStream, removeIf, stream`

### Methods inherited from interface java.lang.Iterable

`forEach`

### Constructor Detail

#### BitSetIntSet

    public BitSetIntSet()

#### BitSetIntSet

    public BitSetIntSet(int initCap)

Parameters:
  `initCap` - initial capacity.

#### BitSetIntSet

    public BitSetIntSet(int initCap,
                        Collection<Integer> coll)

Parameters:
  `initCap` - initial capacity.
  `coll` - initial collection.

### Method Detail

#### size

    public int size()

Specified by:
  `size` in interface `Collection<Integer>`
Specified by:
  `size` in interface `Set<Integer>`
Specified by:
  `size` in class `AbstractCollection<Integer>`

#### contains

    public boolean contains(Object o)

Specified by:
  `contains` in interface `Collection<Integer>`
Specified by:
  `contains` in interface `Set<Integer>`
Overrides:
  `contains` in class `AbstractCollection<Integer>`

#### contains

    public boolean contains(int element)

Returns `true` if this set contains the specified element.

Specified by:
  `contains` in interface `IntSet`

#### iterator

    @NotNull
    public @NotNull Iterator<Integer> iterator()

Specified by:
  `iterator` in interface `Iterable<Integer>`
Specified by:
  `iterator` in interface `Collection<Integer>`
Specified by:
  `iterator` in interface `Set<Integer>`
Specified by:
  `iterator` in class `AbstractCollection<Integer>`

#### add

    public boolean add(Integer integer)

Specified by:
  `add` in interface `Collection<Integer>`
Specified by:
  `add` in interface `Set<Integer>`
Overrides:
  `add` in class `AbstractCollection<Integer>`

#### add

    public boolean add(int element)

Adds the specified element to this set.

Specified by:
  `add` in interface `IntSet`

#### remove

    public boolean remove(Object o)

Specified by:
  `remove` in interface `Collection<Integer>`
Specified by:
  `remove` in interface `Set<Integer>`
Overrides:
  `remove` in class `AbstractCollection<Integer>`

#### remove

    public boolean remove(int element)

Removes the specified element from this set.

Specified by:
  `remove` in interface `IntSet`

#### toIntArray

    public int[] toIntArray()

Returns array with primitive types

Specified by:
  `toIntArray` in interface `IntSet`

#### containsAll

    public boolean containsAll(@NotNull
                               @NotNull Collection<?> c)

Specified by:
  `containsAll` in interface `Collection<Integer>`
Specified by:
  `containsAll` in interface `Set<Integer>`
Overrides:
  `containsAll` in class `AbstractCollection<Integer>`

#### addAll

    public boolean addAll(@NotNull
                          @NotNull Collection<? extends Integer> c)

Specified by:
  `addAll` in interface `Collection<Integer>`
Specified by:
  `addAll` in interface `Set<Integer>`
Overrides:
  `addAll` in class `AbstractCollection<Integer>`

#### retainAll

    public boolean retainAll(@NotNull
                             @NotNull Collection<?> c)

Unsupported operation.

Specified by:
  `retainAll` in interface `Collection<Integer>`
Specified by:
  `retainAll` in interface `Set<Integer>`
Overrides:
  `retainAll` in class `AbstractCollection<Integer>`

#### removeAll

    public boolean removeAll(@NotNull
                             @NotNull Collection<?> c)

Specified by:
  `removeAll` in interface `Collection<Integer>`
Specified by:
  `removeAll` in interface `Set<Integer>`
Overrides:
  `removeAll` in class `AbstractCollection<Integer>`

#### clear

    public void clear()

Specified by:
  `clear` in interface `Collection<Integer>`
Specified by:
  `clear` in interface `Set<Integer>`
Overrides:
  `clear` in class `AbstractCollection<Integer>`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023