Package org.infinispan.commons.util
Class SmallIntSet
java.lang.Object
org.infinispan.commons.util.SmallIntSet
Deprecated, for removal: This API element is subject to removal in a future version.
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 SummaryConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.SmallIntSet(int initialRange) Deprecated, for removal: This API element is subject to removal in a future version.Create a newIntSetand pre-allocate space for elements0..initialRange-1.SmallIntSet(Set<Integer> set) Deprecated, for removal: This API element is subject to removal in a future version.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanadd(int i) Deprecated, for removal: This API element is subject to removal in a future version.Add an integer to the set without boxing the parameter.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanaddAll(Collection<? extends Integer> c) Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.Adds all ints from the provided set into this oneintcapacity()Deprecated, for removal: This API element is subject to removal in a future version.voidclear()Deprecated, for removal: This API element is subject to removal in a future version.booleancontains(int i) Deprecated, for removal: This API element is subject to removal in a future version.Check if the set contains an integer without boxing the parameter.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleancontainsAll(Collection<?> c) Deprecated, for removal: This API element is subject to removal in a future version.booleancontainsAll(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 IntSetbooleanDeprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.voidforEach(IntConsumer action) Deprecated, for removal: This API element is subject to removal in a future version.Performs the given action for each int of theIntSetuntil all elements have been processed or the action throws an exception.static SmallIntSetfrom(byte[] bytes) Deprecated, for removal: This API element is subject to removal in a future version.static SmallIntSetDeprecated, for removal: This API element is subject to removal in a future version.Either converts the given set to an IntSet if it is one or creates a new IntSet and copies the contentsinthashCode()Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Creates aSpliterator.OfIntover 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 setbooleanisEmpty()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.static SmallIntSetof(int i1) Deprecated, for removal: This API element is subject to removal in a future version.static SmallIntSetof(int... elements) Deprecated, for removal: This API element is subject to removal in a future version.static SmallIntSetof(int i1, int i2) Deprecated, for removal: This API element is subject to removal in a future version.static SmallIntSetof(int i1, int i2, int i3) Deprecated, for removal: This API element is subject to removal in a future version.static SmallIntSetof(PrimitiveIterator.OfInt iterator) Deprecated, for removal: This API element is subject to removal in a future version.static SmallIntSetreadFrom(ObjectInput input) Deprecated, for removal: This API element is subject to removal in a future version.booleanremove(int i) Deprecated, for removal: This API element is subject to removal in a future version.Remove an integer from the set without boxing.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanremoveAll(Collection<?> c) Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.Removes all ints from this IntSet that are in the provided IntSetbooleanremoveIf(IntPredicate filter) Deprecated, for removal: This API element is subject to removal in a future version.Removes all of the ints of this set that satisfy the given predicate.booleanretainAll(Collection<?> c) Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.Modifies this set to remove all ints that are not present in the provided IntSetvoidset(int i) Deprecated, for removal: This API element is subject to removal in a future version.Add an integer to the set without boxing the parameter or checking if the integer was already present in the set.voidset(int i, boolean value) Deprecated, for removal: This API element is subject to removal in a future version.Ifvalueistrue, add the integer to the set, otherwise remove the integer from the set.intsize()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.toString()Deprecated, for removal: This API element is subject to removal in a future version.static voidwriteTo(ObjectOutput output, SmallIntSet set) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, removeIf, toArrayMethods inherited from interface java.util.Setspliterator
- 
Constructor Details- 
SmallIntSetpublic SmallIntSet()Deprecated, for removal: This API element is subject to removal in a future version.
- 
SmallIntSetpublic SmallIntSet(int initialRange) Deprecated, for removal: This API element is subject to removal in a future version.Create a newIntSetand pre-allocate space for elements0..initialRange-1.
- 
SmallIntSetDeprecated, for removal: This API element is subject to removal in a future version.
 
- 
- 
Method Details- 
ofDeprecated, for removal: This API element is subject to removal in a future version.
- 
ofDeprecated, for removal: This API element is subject to removal in a future version.
- 
ofDeprecated, for removal: This API element is subject to removal in a future version.
- 
ofDeprecated, for removal: This API element is subject to removal in a future version.
- 
ofDeprecated, for removal: This API element is subject to removal in a future version.
- 
fromDeprecated, for removal: This API element is subject to removal in a future version.
- 
fromDeprecated, for removal: This API element is subject to removal in a future version.Either converts the given set to an IntSet if it is one or creates a new IntSet and copies the contents- Parameters:
- set-
- Returns:
 
- 
sizepublic int size()Deprecated, for removal: This API element is subject to removal in a future version.
- 
capacitypublic int capacity()Deprecated, for removal: This API element is subject to removal in a future version.
- 
isEmptypublic boolean isEmpty()Deprecated, for removal: This API element is subject to removal in a future version.
- 
containsDeprecated, for removal: This API element is subject to removal in a future version.
- 
containsDeprecated, for removal: This API element is subject to removal in a future version.
- 
containspublic boolean contains(int i) Deprecated, for removal: This API element is subject to removal in a future version.Check if the set contains an integer without boxing the parameter.
- 
iteratorDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSetA primtive iterator that allows iteration over the int values. This iterator supports removal if the set is modifiable.
- 
toIntArraypublic int[] toIntArray()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSetReturns 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:
- toIntArrayin interface- IntSet
- Returns:
- this int set as an array
 
- 
toBitSetpublic byte[] toBitSet()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSetReturns 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. 
- 
toArrayDeprecated, for removal: This API element is subject to removal in a future version.
- 
toArraypublic <T> T[] toArray(T[] a) Deprecated, for removal: This API element is subject to removal in a future version.
- 
addDeprecated, for removal: This API element is subject to removal in a future version.
- 
addpublic boolean add(int i) Deprecated, for removal: This API element is subject to removal in a future version.Add an integer to the set without boxing the parameter.
- 
setpublic void set(int i) Deprecated, for removal: This API element is subject to removal in a future version.Add an integer to the set without boxing the parameter or checking if the integer was already present in the set.
- 
setpublic void set(int i, boolean value) Deprecated, for removal: This API element is subject to removal in a future version.Ifvalueistrue, add the integer to the set, otherwise remove the integer from the set.
- 
removeDeprecated, for removal: This API element is subject to removal in a future version.
- 
removepublic boolean remove(int i) Deprecated, for removal: This API element is subject to removal in a future version.Remove an integer from the set without boxing.
- 
containsAllDeprecated, for removal: This API element is subject to removal in a future version.- Specified by:
- containsAllin interface- Collection<Integer>
- Specified by:
- containsAllin interface- Set<Integer>
 
- 
containsAllDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSetWhether this set contains all ints in the given IntSet- Specified by:
- containsAllin interface- IntSet
- Parameters:
- set- the set to check if all are present
- Returns:
- if the set contains all the ints
 
- 
addAllDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSetAdds all ints from the provided set into this one
- 
addAllDeprecated, for removal: This API element is subject to removal in a future version.
- 
removeAllDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSetRemoves all ints from this IntSet that are in the provided IntSet
- 
removeAllDeprecated, for removal: This API element is subject to removal in a future version.
- 
retainAllDeprecated, for removal: This API element is subject to removal in a future version.
- 
retainAllDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSetModifies this set to remove all ints that are not present in the provided IntSet
- 
clearpublic void clear()Deprecated, for removal: This API element is subject to removal in a future version.
- 
intStreamDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSetA stream of ints representing the data in this set
- 
forEachDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSetPerforms the given action for each int of theIntSetuntil 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.
- 
forEachDeprecated, for removal: This API element is subject to removal in a future version.
- 
intSpliteratorDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSetCreates aSpliterator.OfIntover the ints in this set.The Spliterator.OfIntreportsSpliterator.DISTINCT. Implementations should document the reporting of additional characteristic values.- Specified by:
- intSpliteratorin interface- IntSet
- Returns:
- a Spliterator.OfIntover the ints in this set
 
- 
removeIfDeprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IntSetRemoves 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.
- 
equalsDeprecated, for removal: This API element is subject to removal in a future version.
- 
hashCodepublic int hashCode()Deprecated, for removal: This API element is subject to removal in a future version.
- 
toStringDeprecated, for removal: This API element is subject to removal in a future version.
- 
writeToDeprecated, for removal: This API element is subject to removal in a future version.- Throws:
- IOException
 
- 
readFromDeprecated, for removal: This API element is subject to removal in a future version.- Throws:
- IOException
 
 
- 
IntSetsmethods such asIntSets.mutableEmptySet(),IntSets.mutableCopyFrom(Set)