Package org.infinispan.commons.util
Class SmallIntSet
java.lang.Object
org.infinispan.commons.util.SmallIntSet
Deprecated.
Represent a set of integers (e.g. segments) as a
BitSet
.
Memory usage depends on the highest element, as in BitSet
and unlike in other collections such as
HashSet
.- Since:
- 9.0
- Author:
- Dan Berindei
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.SmallIntSet
(int initialRange) Deprecated.Create a newIntSet
and pre-allocate space for elements0..initialRange-1
.SmallIntSet
(Set<Integer> set) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(int i) Deprecated.Add an integer to the set without boxing the parameter.boolean
Deprecated.boolean
addAll
(Collection<? extends Integer> c) Deprecated.boolean
Deprecated.Adds all ints from the provided set into this oneint
capacity()
Deprecated.void
clear()
Deprecated.boolean
contains
(int i) Deprecated.Check if the set contains an integer without boxing the parameter.boolean
Deprecated.boolean
Deprecated.boolean
containsAll
(Collection<?> c) Deprecated.boolean
containsAll
(IntSet set) Deprecated.Whether this set contains all ints in the given IntSetboolean
Deprecated.void
Deprecated.void
forEach
(IntConsumer action) Deprecated.Performs the given action for each int of theIntSet
until all elements have been processed or the action throws an exception.static SmallIntSet
from
(byte[] bytes) Deprecated.static SmallIntSet
Deprecated.Either converts the given set to an IntSet if it is one or creates a new IntSet and copies the contentsint
hashCode()
Deprecated.Deprecated.Creates aSpliterator.OfInt
over the ints in this set.Deprecated.A stream of ints representing the data in this setboolean
isEmpty()
Deprecated.iterator()
Deprecated.A primtive iterator that allows iteration over the int values.static SmallIntSet
of
(int i1) Deprecated.static SmallIntSet
of
(int... elements) Deprecated.static SmallIntSet
of
(int i1, int i2) Deprecated.static SmallIntSet
of
(int i1, int i2, int i3) Deprecated.static SmallIntSet
of
(PrimitiveIterator.OfInt iterator) Deprecated.static SmallIntSet
readFrom
(ObjectInput input) Deprecated.boolean
remove
(int i) Deprecated.Remove an integer from the set without boxing.boolean
Deprecated.boolean
removeAll
(Collection<?> c) Deprecated.boolean
Deprecated.Removes all ints from this IntSet that are in the provided IntSetboolean
removeIf
(IntPredicate filter) Deprecated.Removes all of the ints of this set that satisfy the given predicate.boolean
retainAll
(Collection<?> c) Deprecated.boolean
Deprecated.Modifies this set to remove all ints that are not present in the provided IntSetvoid
set
(int i) Deprecated.Add an integer to the set without boxing the parameter or checking if the integer was already present in the set.void
set
(int i, boolean value) Deprecated.Ifvalue
istrue
, add the integer to the set, otherwise remove the integer from the set.int
size()
Deprecated.Object[]
toArray()
Deprecated.<T> T[]
toArray
(T[] a) Deprecated.byte[]
toBitSet()
Deprecated.Returns a byte array that has a bit set for each int in this set where each byte represents 8 numbers.int[]
Deprecated.Returns an array containing all of the elements in this set.toString()
Deprecated.static void
writeTo
(ObjectOutput output, SmallIntSet set) Deprecated.
-
Constructor Details
-
SmallIntSet
public SmallIntSet()Deprecated. -
SmallIntSet
public SmallIntSet(int initialRange) Deprecated.Create a newIntSet
and pre-allocate space for elements0..initialRange-1
. -
SmallIntSet
Deprecated.
-
-
Method Details
-
of
Deprecated. -
of
Deprecated. -
of
Deprecated. -
of
Deprecated. -
of
Deprecated. -
from
Deprecated. -
from
Deprecated.Either converts the given set to an IntSet if it is one or creates a new IntSet and copies the contents- Parameters:
set
-- Returns:
-
size
public int size()Deprecated. -
capacity
public int capacity()Deprecated. -
isEmpty
public boolean isEmpty()Deprecated. -
contains
Deprecated. -
contains
Deprecated. -
contains
public boolean contains(int i) Deprecated.Check if the set contains an integer without boxing the parameter. -
iterator
Deprecated.Description copied from interface:IntSet
A primtive iterator that allows iteration over the int values. This iterator supports removal if the set is modifiable. -
toIntArray
public int[] toIntArray()Deprecated.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.- Specified by:
toIntArray
in interfaceIntSet
- Returns:
- this int set as an array
-
toBitSet
public byte[] toBitSet()Deprecated.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.
-
toArray
Deprecated. -
toArray
public <T> T[] toArray(T[] a) Deprecated. -
add
Deprecated. -
add
public boolean add(int i) Deprecated.Add an integer to the set without boxing the parameter. -
set
public void set(int i) Deprecated.Add an integer to the set without boxing the parameter or checking if the integer was already present in the set. -
set
public void set(int i, boolean value) Deprecated.Ifvalue
istrue
, add the integer to the set, otherwise remove the integer from the set. -
remove
Deprecated. -
remove
public boolean remove(int i) Deprecated.Remove an integer from the set without boxing. -
containsAll
Deprecated. -
containsAll
Deprecated.Description copied from interface:IntSet
Whether this set contains all ints in the given IntSet- Specified by:
containsAll
in interfaceIntSet
- Parameters:
set
- the set to check if all are present- Returns:
- if the set contains all the ints
-
addAll
Deprecated.Description copied from interface:IntSet
Adds all ints from the provided set into this one -
addAll
Deprecated. -
removeAll
Deprecated.Description copied from interface:IntSet
Removes all ints from this IntSet that are in the provided IntSet -
removeAll
Deprecated. -
retainAll
Deprecated. -
retainAll
Deprecated.Description copied from interface:IntSet
Modifies this set to remove all ints that are not present in the provided IntSet -
clear
public void clear()Deprecated. -
intStream
Deprecated.Description copied from interface:IntSet
A stream of ints representing the data in this set -
forEach
Deprecated.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. -
forEach
Deprecated. -
intSpliterator
Deprecated.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.- Specified by:
intSpliterator
in interfaceIntSet
- Returns:
- a
Spliterator.OfInt
over the ints in this set
-
removeIf
Deprecated.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. -
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
toString
Deprecated. -
writeTo
Deprecated.- Throws:
IOException
-
readFrom
Deprecated.- Throws:
IOException
-
IntSets
methods such asIntSets.mutableEmptySet()
,IntSets.mutableCopyFrom(Set)