Package org.infinispan.commons.util
Class SmallIntSet
- java.lang.Object
-
- org.infinispan.commons.util.SmallIntSet
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Integer>
,java.util.Collection<java.lang.Integer>
,java.util.Set<java.lang.Integer>
,IntSet
@Deprecated public class SmallIntSet extends java.lang.Object implements IntSet
Deprecated.since 9.3 This class will no longer be public. Please useIntSets
methods such asIntSets.mutableEmptySet()
,IntSets.mutableCopyFrom(Set)
Represent a set of integers (e.g. segments) as aBitSet
. Memory usage depends on the highest element, as inBitSet
and 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 newIntSet
and pre-allocate space for elements0..initialRange-1
.SmallIntSet(java.util.Set<java.lang.Integer> set)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
add(int i)
Deprecated.Add an integer to the set without boxing the parameter.boolean
add(java.lang.Integer i)
Deprecated.boolean
addAll(java.util.Collection<? extends java.lang.Integer> c)
Deprecated.boolean
addAll(IntSet set)
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
contains(java.lang.Integer o)
Deprecated.boolean
contains(java.lang.Object o)
Deprecated.boolean
containsAll(java.util.Collection<?> c)
Deprecated.boolean
containsAll(IntSet set)
Deprecated.Whether this set contains all ints in the given IntSetboolean
equals(java.lang.Object o)
Deprecated.void
forEach(java.util.function.Consumer<? super java.lang.Integer> action)
Deprecated.void
forEach(java.util.function.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(java.util.Set<java.lang.Integer> set)
Deprecated.Either converts the given set to an IntSet if it is one or creates a new IntSet and copies the contentsint
hashCode()
Deprecated.java.util.Spliterator.OfInt
intSpliterator()
Deprecated.Creates aSpliterator.OfInt
over the ints in this set.java.util.stream.IntStream
intStream()
Deprecated.A stream of ints representing the data in this setboolean
isEmpty()
Deprecated.java.util.PrimitiveIterator.OfInt
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(java.util.PrimitiveIterator.OfInt iterator)
Deprecated.static SmallIntSet
readFrom(java.io.ObjectInput input)
Deprecated.boolean
remove(int i)
Deprecated.Remove an integer from the set without boxing.boolean
remove(java.lang.Object o)
Deprecated.boolean
removeAll(java.util.Collection<?> c)
Deprecated.boolean
removeAll(IntSet set)
Deprecated.Removes all ints from this IntSet that are in the provided IntSetboolean
removeIf(java.util.function.IntPredicate filter)
Deprecated.Removes all of the ints of this set that satisfy the given predicate.boolean
retainAll(java.util.Collection<?> c)
Deprecated.boolean
retainAll(IntSet c)
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.java.lang.Object[]
toArray()
Deprecated.<T> T[]
toArray(T[] a)
Deprecated.int[]
toIntArray()
Deprecated.Returns an array containing all of the elements in this set.java.lang.String
toString()
Deprecated.static void
writeTo(java.io.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(java.util.PrimitiveIterator.OfInt iterator)
Deprecated.
-
from
public static SmallIntSet from(java.util.Set<java.lang.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.- Specified by:
size
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
size
in interfacejava.util.Set<java.lang.Integer>
-
capacity
public int capacity()
Deprecated.
-
isEmpty
public boolean isEmpty()
Deprecated.- Specified by:
isEmpty
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
isEmpty
in interfacejava.util.Set<java.lang.Integer>
-
contains
public boolean contains(java.lang.Object o)
Deprecated.- Specified by:
contains
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
contains
in interfacejava.util.Set<java.lang.Integer>
-
contains
public boolean contains(java.lang.Integer o)
Deprecated.
-
contains
public boolean contains(int i)
Deprecated.Check if the set contains an integer without boxing the parameter.
-
iterator
public java.util.PrimitiveIterator.OfInt 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
-
toArray
public java.lang.Object[] toArray()
Deprecated.- Specified by:
toArray
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
toArray
in interfacejava.util.Set<java.lang.Integer>
-
toArray
public <T> T[] toArray(T[] a)
Deprecated.- Specified by:
toArray
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
toArray
in interfacejava.util.Set<java.lang.Integer>
-
add
public boolean add(java.lang.Integer i)
Deprecated.- Specified by:
add
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
add
in interfacejava.util.Set<java.lang.Integer>
-
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
public boolean remove(java.lang.Object o)
Deprecated.- Specified by:
remove
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
remove
in interfacejava.util.Set<java.lang.Integer>
-
remove
public boolean remove(int i)
Deprecated.Remove an integer from the set without boxing.
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
Deprecated.- Specified by:
containsAll
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
containsAll
in interfacejava.util.Set<java.lang.Integer>
-
containsAll
public boolean containsAll(IntSet set)
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
public boolean addAll(IntSet set)
Deprecated.Description copied from interface:IntSet
Adds all ints from the provided set into this one
-
addAll
public boolean addAll(java.util.Collection<? extends java.lang.Integer> c)
Deprecated.- Specified by:
addAll
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
addAll
in interfacejava.util.Set<java.lang.Integer>
-
removeAll
public boolean removeAll(IntSet set)
Deprecated.Description copied from interface:IntSet
Removes all ints from this IntSet that are in the provided IntSet
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
Deprecated.- Specified by:
removeAll
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
removeAll
in interfacejava.util.Set<java.lang.Integer>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
Deprecated.- Specified by:
retainAll
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
retainAll
in interfacejava.util.Set<java.lang.Integer>
-
retainAll
public boolean retainAll(IntSet c)
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.- Specified by:
clear
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
clear
in interfacejava.util.Set<java.lang.Integer>
-
intStream
public java.util.stream.IntStream intStream()
Deprecated.Description copied from interface:IntSet
A stream of ints representing the data in this set
-
forEach
public void forEach(java.util.function.IntConsumer action)
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
public void forEach(java.util.function.Consumer<? super java.lang.Integer> action)
Deprecated.- Specified by:
forEach
in interfacejava.lang.Iterable<java.lang.Integer>
-
intSpliterator
public java.util.Spliterator.OfInt 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
public boolean removeIf(java.util.function.IntPredicate filter)
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
public boolean equals(java.lang.Object o)
Deprecated.- Specified by:
equals
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
equals
in interfacejava.util.Set<java.lang.Integer>
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Deprecated.- Specified by:
hashCode
in interfacejava.util.Collection<java.lang.Integer>
- Specified by:
hashCode
in interfacejava.util.Set<java.lang.Integer>
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
-
writeTo
public static void writeTo(java.io.ObjectOutput output, SmallIntSet set) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
readFrom
public static SmallIntSet readFrom(java.io.ObjectInput input) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
-