Package org.infinispan.commons.util
Class SmallIntSet
- java.lang.Object
-
- org.infinispan.commons.util.SmallIntSet
-
@Deprecated public class SmallIntSet extends Object implements IntSet
Deprecated.since 9.3 This class will no longer be public. Please useIntSetsmethods such asIntSets.mutableEmptySet(),IntSets.mutableCopyFrom(Set)Represent a set of integers (e.g. segments) as aBitSet. Memory usage depends on the highest element, as inBitSetand unlike in other collections such asHashSet.- Since:
- 9.0
- Author:
- Dan Berindei
-
-
Constructor Summary
Constructors Constructor Description SmallIntSet()Deprecated.SmallIntSet(int initialRange)Deprecated.Create a newIntSetand pre-allocate space for elements0..initialRange-1.SmallIntSet(Set<Integer> set)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(int i)Deprecated.Add an integer to the set without boxing the parameter.booleanadd(Integer i)Deprecated.booleanaddAll(Collection<? extends Integer> c)Deprecated.booleanaddAll(IntSet set)Deprecated.Adds all ints from the provided set into this oneintcapacity()Deprecated.voidclear()Deprecated.booleancontains(int i)Deprecated.Check if the set contains an integer without boxing the parameter.booleancontains(Integer o)Deprecated.booleancontains(Object o)Deprecated.booleancontainsAll(Collection<?> c)Deprecated.booleancontainsAll(IntSet set)Deprecated.Whether this set contains all ints in the given IntSetbooleanequals(Object o)Deprecated.voidforEach(Consumer<? super Integer> action)Deprecated.voidforEach(IntConsumer action)Deprecated.Performs the given action for each int of theIntSetuntil all elements have been processed or the action throws an exception.static SmallIntSetfrom(Set<Integer> set)Deprecated.Either converts the given set to an IntSet if it is one or creates a new IntSet and copies the contentsinthashCode()Deprecated.Spliterator.OfIntintSpliterator()Deprecated.Creates aSpliterator.OfIntover the ints in this set.IntStreamintStream()Deprecated.A stream of ints representing the data in this setbooleanisEmpty()Deprecated.PrimitiveIterator.OfIntiterator()Deprecated.A primtive iterator that allows iteration over the int values.static SmallIntSetof(int i1)Deprecated.static SmallIntSetof(int... elements)Deprecated.static SmallIntSetof(int i1, int i2)Deprecated.static SmallIntSetof(int i1, int i2, int i3)Deprecated.static SmallIntSetof(PrimitiveIterator.OfInt iterator)Deprecated.static SmallIntSetreadFrom(ObjectInput input)Deprecated.booleanremove(int i)Deprecated.Remove an integer from the set without boxing.booleanremove(Object o)Deprecated.booleanremoveAll(Collection<?> c)Deprecated.booleanremoveAll(IntSet set)Deprecated.Removes all ints from this IntSet that are in the provided IntSetbooleanremoveIf(IntPredicate filter)Deprecated.Removes all of the ints of this set that satisfy the given predicate.booleanretainAll(Collection<?> c)Deprecated.booleanretainAll(IntSet c)Deprecated.Modifies this set to remove all ints that are not present in the provided IntSetvoidset(int i)Deprecated.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.Ifvalueistrue, add the integer to the set, otherwise remove the integer from the set.intsize()Deprecated.Object[]toArray()Deprecated.<T> T[]toArray(T[] a)Deprecated.int[]toIntArray()Deprecated.Returns an array containing all of the elements in this set.StringtoString()Deprecated.static voidwriteTo(ObjectOutput output, SmallIntSet set)Deprecated.
-
-
-
Method Detail
-
of
public static SmallIntSet of(int i1)
Deprecated.
-
of
public static SmallIntSet of(int i1, int i2)
Deprecated.
-
of
public static SmallIntSet of(int i1, int i2, int i3)
Deprecated.
-
of
public static SmallIntSet of(int... elements)
Deprecated.
-
of
public static SmallIntSet of(PrimitiveIterator.OfInt iterator)
Deprecated.
-
from
public static SmallIntSet from(Set<Integer> set)
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
public boolean contains(Object o)
Deprecated.
-
contains
public boolean contains(Integer o)
Deprecated.
-
contains
public boolean contains(int i)
Deprecated.Check if the set contains an integer without boxing the parameter.
-
iterator
public PrimitiveIterator.OfInt iterator()
Deprecated.Description copied from interface:IntSetA 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: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 interfaceIntSet- Returns:
- this int set as an array
-
toArray
public Object[] toArray()
Deprecated.
-
toArray
public <T> T[] toArray(T[] a)
Deprecated.
-
add
public boolean add(Integer i)
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.Ifvalueistrue, add the integer to the set, otherwise remove the integer from the set.
-
remove
public boolean remove(Object o)
Deprecated.
-
remove
public boolean remove(int i)
Deprecated.Remove an integer from the set without boxing.
-
containsAll
public boolean containsAll(Collection<?> c)
Deprecated.
-
containsAll
public boolean containsAll(IntSet set)
Deprecated.Description copied from interface:IntSetWhether this set contains all ints in the given IntSet- Specified by:
containsAllin interfaceIntSet- Parameters:
set- the set to check if all are present- Returns:
- if the set contains all the ints
-
addAll
public boolean addAll(IntSet set)
Deprecated.Description copied from interface:IntSetAdds all ints from the provided set into this one
-
addAll
public boolean addAll(Collection<? extends Integer> c)
Deprecated.
-
removeAll
public boolean removeAll(IntSet set)
Deprecated.Description copied from interface:IntSetRemoves all ints from this IntSet that are in the provided IntSet
-
removeAll
public boolean removeAll(Collection<?> c)
Deprecated.
-
retainAll
public boolean retainAll(Collection<?> c)
Deprecated.
-
retainAll
public boolean retainAll(IntSet c)
Deprecated.Description copied from interface:IntSetModifies this set to remove all ints that are not present in the provided IntSet
-
clear
public void clear()
Deprecated.
-
intStream
public IntStream intStream()
Deprecated.Description copied from interface:IntSetA stream of ints representing the data in this set
-
forEach
public void forEach(IntConsumer action)
Deprecated.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.
-
intSpliterator
public Spliterator.OfInt intSpliterator()
Deprecated.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 interfaceIntSet- Returns:
- a
Spliterator.OfIntover the ints in this set
-
removeIf
public boolean removeIf(IntPredicate filter)
Deprecated.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.
-
equals
public boolean equals(Object o)
Deprecated.
-
hashCode
public int hashCode()
Deprecated.
-
toString
public String toString()
Deprecated.
-
writeTo
public static void writeTo(ObjectOutput output, SmallIntSet set) throws IOException
Deprecated.- Throws:
IOException
-
readFrom
public static SmallIntSet readFrom(ObjectInput input) throws IOException
Deprecated.- Throws:
IOException
-
-