com.hazelcast.util.collection

## Class IntHashSet

- java.lang.Object
- - com.hazelcast.util.collection.IntHashSet

- All Implemented Interfaces:
    Iterable<Integer>, Collection<Integer>, Set<Integer>

      public final class IntHashSet
      extends Object
      implements Set<Integer>

  Simple fixed-size int hashset.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `MAX_CAPACITY` Maximum supported capacity

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IntHashSet(int capacity, int missingValue)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `add(int value)` Primitive specialised overload of {this#add(Integer)}
    `boolean` | `add(Integer value)`
    `boolean` | `addAll(Collection<? extends Integer> coll)`
    `void` | `clear()`
    `boolean` | `contains(int value)`
    `boolean` | `contains(Object value)`
    `boolean` | `containsAll(Collection<?> coll)`
    `boolean` | `containsAll(IntHashSet other)` IntHashSet specialised variant of {this#containsAll(Collection)}.
    `void` | `copy(IntHashSet obj)`
    `IntHashSet` | `difference(IntHashSet collection)` Fast Path set difference for comparison with another IntHashSet.
    `boolean` | `equals(Object other)`
    `int` | `hashCode()`
    `boolean` | `isEmpty()`
    `IntIterator` | `iterator()`
    `boolean` | `remove(int value)` An int specialised version of {this#remove(Object)}.
    `boolean` | `remove(Object value)`
    `boolean` | `removeAll(Collection<?> coll)`
    `boolean` | `retainAll(Collection<?> coll)`
    `int` | `size()`
    `Object[]` | `toArray()`
    `<T> T[]` | `toArray(T[] into)`
    `String` | `toString()`

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

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

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

      `spliterator`

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

      `parallelStream, removeIf, stream`

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

      `forEach`

- - ### Field Detail

    - #### MAX_CAPACITY

          public static final int MAX_CAPACITY

      Maximum supported capacity
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### IntHashSet

          public IntHashSet(int capacity,
                            int missingValue)

  - ### Method Detail

    - #### add

          public boolean add(Integer value)

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

    - #### add

          public boolean add(int value)

      Primitive specialised overload of {this#add(Integer)}
      Parameters:
        `value` - the value to add
      Returns:
        true if the collection has changed, false otherwise

    - #### remove

          public boolean remove(Object value)

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

    - #### remove

          public boolean remove(int value)

      An int specialised version of {this#remove(Object)}.
      Parameters:
        `value` - the value to remove
      Returns:
        true if the value was present, false otherwise

    - #### contains

          public boolean contains(Object value)

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

    - #### contains

          public boolean contains(int value)

    - #### size

          public int size()

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

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `Collection<Integer>`
      Specified by:
        `isEmpty` in interface `Set<Integer>`

    - #### clear

          public void clear()

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

    - #### addAll

          public boolean addAll(Collection<? extends Integer> coll)

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

    - #### containsAll

          public boolean containsAll(Collection<?> coll)

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

    - #### containsAll

          public boolean containsAll(IntHashSet other)

      IntHashSet specialised variant of {this#containsAll(Collection)}.
      Parameters:
        `other` - the int hashset to compare against.
      Returns:
        true if every element in other is in this.

    - #### difference

          public IntHashSet difference(IntHashSet collection)

      Fast Path set difference for comparison with another IntHashSet.

      NB: garbage free in the identical case, allocates otherwise.
      Parameters:
        `collection` - the other set to subtract
      Returns:
        null if identical, otherwise the set of differences

    - #### removeAll

          public boolean removeAll(Collection<?> coll)

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

    - #### iterator

          public IntIterator iterator()

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

    - #### copy

          public void copy(IntHashSet obj)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toArray

          public Object[] toArray()

      Specified by:
        `toArray` in interface `Collection<Integer>`
      Specified by:
        `toArray` in interface `Set<Integer>`

    - #### toArray

          public <T> T[] toArray(T[] into)

      Specified by:
        `toArray` in interface `Collection<Integer>`
      Specified by:
        `toArray` in interface `Set<Integer>`

    - #### equals

          public boolean equals(Object other)

      Specified by:
        `equals` in interface `Collection<Integer>`
      Specified by:
        `equals` in interface `Set<Integer>`
      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Collection<Integer>`
      Specified by:
        `hashCode` in interface `Set<Integer>`
      Overrides:
        `hashCode` in class `Object`

    - #### retainAll

          public boolean retainAll(Collection<?> coll)

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

Copyright © 2019. All rights reserved.