Package org.infinispan.commons.util
Class ImmutableIntSet
java.lang.Object
org.infinispan.commons.util.ImmutableIntSet
Deprecated, for removal: This API element is subject to removal in a future version.
Immutable wrapper for
IntSet
.- Since:
- 9.2
- Author:
- Dan Berindei
-
Constructor Summary
ConstructorDescriptionImmutableIntSet
(IntSet set) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(int i) Adds the given int to this set and returnstrue
if it was set orfalse
if it was already presentboolean
boolean
addAll
(Collection<? extends Integer> c) boolean
Deprecated, for removal: This API element is subject to removal in a future version.Adds all ints from the provided set into this onevoid
clear()
boolean
contains
(int i) Deprecated, for removal: This API element is subject to removal in a future version.Whether this set contains the given intboolean
Deprecated, for removal: This API element is subject to removal in a future version.boolean
containsAll
(Collection<?> c) Deprecated, for removal: This API element is subject to removal in a future version.boolean
containsAll
(IntSet set) Deprecated, for removal: This API element is subject to removal in a future version.Whether this set contains all ints in the given IntSetvoid
Deprecated, for removal: This API element is subject to removal in a future version.void
forEach
(IntConsumer action) Deprecated, for removal: This API element is subject to removal in a future version.Performs the given action for each int of theIntSet
until all elements have been processed or the action throws an exception.Deprecated, for removal: This API element is subject to removal in a future version.Creates aSpliterator.OfInt
over the ints in this set.Deprecated, for removal: This API element is subject to removal in a future version.A stream of ints representing the data in this setboolean
isEmpty()
Deprecated, for removal: This API element is subject to removal in a future version.iterator()
Deprecated, for removal: This API element is subject to removal in a future version.A primtive iterator that allows iteration over the int values.boolean
remove
(int i) Removes, if present, the int from the set and returns if it was present or notboolean
boolean
removeAll
(Collection<?> c) boolean
Removes all ints from this IntSet that are in the provided IntSetboolean
removeIf
(IntPredicate filter) Removes all of the ints of this set that satisfy the given predicate.boolean
boolean
retainAll
(Collection<?> c) boolean
Modifies this set to remove all ints that are not present in the provided IntSetvoid
set
(int i) Adds or sets the int without returning whether it was previously setint
size()
Deprecated, for removal: This API element is subject to removal in a future version.Object[]
toArray()
Deprecated, for removal: This API element is subject to removal in a future version.<T> T[]
toArray
(T[] a) Deprecated, for removal: This API element is subject to removal in a future version.byte[]
toBitSet()
Deprecated, for removal: This API element is subject to removal in a future version.Returns a byte array that has a bit set for each int in this set where each byte represents 8 numbers.int[]
Deprecated, for removal: This API element is subject to removal in a future version.Returns an array containing all of the elements in this set.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, toArray
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Constructor Details
-
ImmutableIntSet
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
contains
public boolean contains(int i) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSet
Whether this set contains the given int- Parameters:
i
- the int to check- Returns:
- if the set contains the int
-
addAll
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSet
Adds all ints from the provided set into this one -
containsAll
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSet
Whether this set contains all ints in the given IntSet- Parameters:
set
- the set to check if all are present- Returns:
- if the set contains all the ints
-
size
public int size()Deprecated, for removal: This API element is subject to removal in a future version. -
isEmpty
public boolean isEmpty()Deprecated, for removal: This API element is subject to removal in a future version. -
contains
Deprecated, for removal: This API element is subject to removal in a future version. -
iterator
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSet
A primtive iterator that allows iteration over the int values. This iterator supports removal if the set is modifiable.- Returns:
- the iterator
-
toIntArray
public int[] toIntArray()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSet
Returns an array containing all of the elements in this set. If this set makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.- Returns:
- this int set as an array
-
toArray
Deprecated, for removal: This API element is subject to removal in a future version. -
toArray
public <T> T[] toArray(T[] a) Deprecated, for removal: This API element is subject to removal in a future version. -
containsAll
Deprecated, for removal: This API element is subject to removal in a future version. -
intStream
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSet
A stream of ints representing the data in this set- Returns:
- the stream
-
forEach
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSet
Performs the given action for each int of theIntSet
until all elements have been processed or the action throws an exception. Unless otherwise specified by the implementing class, actions are performed in the order of iteration (if an iteration order is specified). Exceptions thrown by the action are relayed to the caller.- Parameters:
action
- The action to be performed for each element
-
forEach
Deprecated, for removal: This API element is subject to removal in a future version. -
intSpliterator
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSet
Creates aSpliterator.OfInt
over the ints in this set.The
Spliterator.OfInt
reportsSpliterator.DISTINCT
. Implementations should document the reporting of additional characteristic values.- Returns:
- a
Spliterator.OfInt
over the ints in this set
-
toBitSet
public byte[] toBitSet()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSet
Returns a byte array that has a bit set for each int in this set where each byte represents 8 numbers. That is if the ints 2, 5 and 9 are set this will return a byte array consisting of 2 bytes in little-endian representation of those values.Depending upon the implementation this array may or may not have trailing bytes and may be condensed to save space.
- Returns:
- a byte array containing a little-endian representation of all the ints of this int set as bits
-
add
public boolean add(int i) Description copied from interface:IntSet
Adds the given int to this set and returnstrue
if it was set orfalse
if it was already present -
set
public void set(int i) Description copied from interface:IntSet
Adds or sets the int without returning whether it was previously set -
remove
public boolean remove(int i) Description copied from interface:IntSet
Removes, if present, the int from the set and returns if it was present or not -
remove
-
removeAll
Description copied from interface:IntSet
Removes all ints from this IntSet that are in the provided IntSet -
removeAll
-
retainAll
Description copied from interface:IntSet
Modifies this set to remove all ints that are not present in the provided IntSet -
retainAll
-
add
-
addAll
-
clear
public void clear() -
removeIf
- Specified by:
removeIf
in interfaceCollection<Integer>
-
removeIf
Description copied from interface:IntSet
Removes all of the ints of this set that satisfy the given predicate. Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller.
-
IntSets.immutableSet(IntSet)