IntSets
methods such as
IntSets.mutableEmptySet()
, IntSets.mutableCopyFrom(Set)
@Deprecated public class SmallIntSet extends Object implements IntSet
BitSet
.
Memory usage depends on the highest element, as in BitSet
and unlike in other collections such as
HashSet
.Constructor and Description |
---|
SmallIntSet()
Deprecated.
|
SmallIntSet(int initialRange)
Deprecated.
Create a new
IntSet and pre-allocate space for elements 0..initialRange-1 . |
SmallIntSet(Set<Integer> set)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(int i)
Deprecated.
Add an integer to the set without boxing the parameter.
|
boolean |
add(Integer i)
Deprecated.
|
boolean |
addAll(Collection<? extends Integer> c)
Deprecated.
|
boolean |
addAll(IntSet set)
Deprecated.
Adds all ints from the provided set into this one
|
int |
capacity()
Deprecated.
|
void |
clear()
Deprecated.
|
boolean |
contains(int i)
Deprecated.
Check if the set contains an integer without boxing the parameter.
|
boolean |
contains(Integer o)
Deprecated.
|
boolean |
contains(Object o)
Deprecated.
|
boolean |
containsAll(Collection<?> c)
Deprecated.
|
boolean |
containsAll(IntSet set)
Deprecated.
Whether this set contains all ints in the given IntSet
|
boolean |
equals(Object o)
Deprecated.
|
void |
forEach(Consumer<? super Integer> action)
Deprecated.
|
void |
forEach(IntConsumer action)
Deprecated.
Performs the given action for each int of the
IntSet
until all elements have been processed or the action throws an
exception. |
static SmallIntSet |
from(byte[] bytes)
Deprecated.
|
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
|
int |
hashCode()
Deprecated.
|
Spliterator.OfInt |
intSpliterator()
Deprecated.
Creates a
Spliterator.OfInt over the ints in this set. |
IntStream |
intStream()
Deprecated.
A stream of ints representing the data in this set
|
boolean |
isEmpty()
Deprecated.
|
PrimitiveIterator.OfInt |
iterator()
Deprecated.
A primtive iterator that allows iteration over the int values.
|
static SmallIntSet |
of(int... elements)
Deprecated.
|
static SmallIntSet |
of(int i1)
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 |
remove(Object o)
Deprecated.
|
boolean |
removeAll(Collection<?> c)
Deprecated.
|
boolean |
removeAll(IntSet set)
Deprecated.
Removes all ints from this IntSet that are in the provided IntSet
|
boolean |
removeIf(IntPredicate filter)
Deprecated.
Removes all of the ints of this set that satisfy the given
predicate.
|
boolean |
retainAll(Collection<?> c)
Deprecated.
|
boolean |
retainAll(IntSet c)
Deprecated.
Modifies this set to remove all ints that are not present in the provided IntSet
|
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.
|
void |
set(int i,
boolean value)
Deprecated.
If
value is true , 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.
|
int[] |
toIntArray()
Deprecated.
Returns an array containing all of the elements in this set.
|
String |
toString()
Deprecated.
|
static void |
writeTo(ObjectOutput output,
SmallIntSet set)
Deprecated.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
spliterator
parallelStream, removeIf
public SmallIntSet()
public SmallIntSet(int initialRange)
IntSet
and pre-allocate space for elements 0..initialRange-1
.public static SmallIntSet of(int i1)
public static SmallIntSet of(int i1, int i2)
public static SmallIntSet of(int i1, int i2, int i3)
public static SmallIntSet of(int... elements)
public static SmallIntSet of(PrimitiveIterator.OfInt iterator)
public static SmallIntSet from(byte[] bytes)
public static SmallIntSet from(Set<Integer> set)
set
- public int size()
public int capacity()
public boolean isEmpty()
public boolean contains(Object o)
public boolean contains(Integer o)
public boolean contains(int i)
public PrimitiveIterator.OfInt iterator()
IntSet
public int[] toIntArray()
IntSet
toIntArray
in interface IntSet
public Object[] toArray()
public <T> T[] toArray(T[] a)
public boolean add(Integer i)
public boolean add(int i)
public void set(int i)
public void set(int i, boolean value)
value
is true
, add the integer to the set, otherwise remove the integer from the set.public boolean remove(Object o)
public boolean remove(int i)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<Integer>
containsAll
in interface Set<Integer>
public boolean containsAll(IntSet set)
IntSet
containsAll
in interface IntSet
set
- the set to check if all are presentpublic boolean addAll(IntSet set)
IntSet
public boolean addAll(Collection<? extends Integer> c)
public boolean removeAll(IntSet set)
IntSet
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public boolean retainAll(IntSet c)
IntSet
public void clear()
public IntStream intStream()
IntSet
public void forEach(IntConsumer action)
IntSet
IntSet
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.public Spliterator.OfInt intSpliterator()
IntSet
Spliterator.OfInt
over the ints in this set.
The Spliterator.OfInt
reports Spliterator.DISTINCT
.
Implementations should document the reporting of additional
characteristic values.
intSpliterator
in interface IntSet
Spliterator.OfInt
over the ints in this setpublic boolean removeIf(IntPredicate filter)
IntSet
public boolean equals(Object o)
public int hashCode()
public static void writeTo(ObjectOutput output, SmallIntSet set) throws IOException
IOException
public static SmallIntSet readFrom(ObjectInput input) throws IOException
IOException
Copyright © 2021 JBoss by Red Hat. All rights reserved.