IntSets methods such as
IntSets.mutableEmptySet(), IntSets.mutableCopyFrom(Set)@Deprecated public class SmallIntSet extends java.lang.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(java.util.Set<java.lang.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(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 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(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 IntSet
|
boolean |
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 the
IntSet
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 contents
|
int |
hashCode()
Deprecated.
|
java.util.Spliterator.OfInt |
intSpliterator()
Deprecated.
Creates a
Spliterator.OfInt over the ints in this set. |
java.util.stream.IntStream |
intStream()
Deprecated.
A stream of ints representing the data in this set
|
boolean |
isEmpty()
Deprecated.
|
java.util.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(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 IntSet
|
boolean |
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 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.
|
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.
|
public SmallIntSet()
public SmallIntSet(int initialRange)
IntSet and pre-allocate space for elements 0..initialRange-1.public SmallIntSet(java.util.Set<java.lang.Integer> set)
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(java.util.PrimitiveIterator.OfInt iterator)
public static SmallIntSet from(java.util.Set<java.lang.Integer> set)
set - public int size()
size in interface java.util.Collection<java.lang.Integer>size in interface java.util.Set<java.lang.Integer>public int capacity()
public boolean isEmpty()
isEmpty in interface java.util.Collection<java.lang.Integer>isEmpty in interface java.util.Set<java.lang.Integer>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<java.lang.Integer>contains in interface java.util.Set<java.lang.Integer>public boolean contains(java.lang.Integer o)
public boolean contains(int i)
public java.util.PrimitiveIterator.OfInt iterator()
IntSetpublic int[] toIntArray()
IntSettoIntArray in interface IntSetpublic java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Integer>toArray in interface java.util.Set<java.lang.Integer>public <T> T[] toArray(T[] a)
toArray in interface java.util.Collection<java.lang.Integer>toArray in interface java.util.Set<java.lang.Integer>public boolean add(java.lang.Integer i)
add in interface java.util.Collection<java.lang.Integer>add in interface java.util.Set<java.lang.Integer>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(java.lang.Object o)
remove in interface java.util.Collection<java.lang.Integer>remove in interface java.util.Set<java.lang.Integer>public boolean remove(int i)
public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<java.lang.Integer>containsAll in interface java.util.Set<java.lang.Integer>public boolean containsAll(IntSet set)
IntSetcontainsAll in interface IntSetset - the set to check if all are presentpublic boolean addAll(IntSet set)
IntSetpublic boolean addAll(java.util.Collection<? extends java.lang.Integer> c)
addAll in interface java.util.Collection<java.lang.Integer>addAll in interface java.util.Set<java.lang.Integer>public boolean removeAll(IntSet set)
IntSetpublic boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Integer>removeAll in interface java.util.Set<java.lang.Integer>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Integer>retainAll in interface java.util.Set<java.lang.Integer>public boolean retainAll(IntSet c)
IntSetpublic void clear()
clear in interface java.util.Collection<java.lang.Integer>clear in interface java.util.Set<java.lang.Integer>public java.util.stream.IntStream intStream()
IntSetpublic void forEach(java.util.function.IntConsumer action)
IntSetIntSet
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 void forEach(java.util.function.Consumer<? super java.lang.Integer> action)
forEach in interface java.lang.Iterable<java.lang.Integer>public java.util.Spliterator.OfInt intSpliterator()
IntSetSpliterator.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 IntSetSpliterator.OfInt over the ints in this setpublic boolean removeIf(java.util.function.IntPredicate filter)
IntSetpublic boolean equals(java.lang.Object o)
equals in interface java.util.Collection<java.lang.Integer>equals in interface java.util.Set<java.lang.Integer>equals in class java.lang.Objectpublic int hashCode()
hashCode in interface java.util.Collection<java.lang.Integer>hashCode in interface java.util.Set<java.lang.Integer>hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static void writeTo(java.io.ObjectOutput output,
SmallIntSet set)
throws java.io.IOException
java.io.IOExceptionpublic static SmallIntSet readFrom(java.io.ObjectInput input) throws java.io.IOException
java.io.IOException