Constructor and Description |
---|
SmallIntSet() |
SmallIntSet(int initialRange)
Create a new
IntSet and pre-allocate space for elements 0..initialRange-1 . |
SmallIntSet(IntSet set) |
SmallIntSet(Set<Integer> set) |
SmallIntSet(SmallIntSet other) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(int i)
Add an integer to the set without boxing the parameter.
|
boolean |
add(Integer i) |
boolean |
addAll(Collection<? extends Integer> c) |
boolean |
addAll(IntSet set)
Adds all ints from the provided set into this one
|
int |
capacity() |
void |
clear() |
boolean |
contains(int i)
Check if the set contains an integer without boxing the parameter.
|
boolean |
contains(Integer o) |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
containsAll(IntSet set)
Whether this set contains all ints in the given IntSet
|
boolean |
equals(Object o) |
static SmallIntSet |
from(Set<Integer> set)
Either converts the given set to an IntSet if it is one or creates a new IntSet and copies the contents
|
int |
hashCode() |
IntStream |
intStream()
A stream of ints representing the data in this set
|
boolean |
isEmpty() |
PrimitiveIterator.OfInt |
iterator()
A primtive iterator that allows iteration over the int values.
|
static SmallIntSet |
of(int... elements) |
static SmallIntSet |
of(int i1) |
static SmallIntSet |
of(int i1,
int i2) |
static SmallIntSet |
of(int i1,
int i2,
int i3) |
static SmallIntSet |
of(PrimitiveIterator.OfInt iterator) |
static SmallIntSet |
readFrom(ObjectInput input) |
boolean |
remove(int i)
Remove an integer from the set without boxing.
|
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
removeAll(IntSet set)
Removes all ints from this IntSet that are in the provided IntSet
|
boolean |
retainAll(Collection<?> c) |
boolean |
retainAll(IntSet c)
Modifies this set to only remove all ints that are not present in the provided IntSet
|
void |
set(int i)
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)
If
value is true , add the integer to the set, otherwise remove the integer from the set. |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
static void |
writeTo(ObjectOutput output,
SmallIntSet set) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
spliterator
parallelStream, removeIf, stream
public SmallIntSet()
public SmallIntSet(int initialRange)
IntSet
and pre-allocate space for elements 0..initialRange-1
.public SmallIntSet(SmallIntSet other)
public SmallIntSet(IntSet 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(PrimitiveIterator.OfInt iterator)
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 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 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 © 2018 JBoss, a division of Red Hat. All rights reserved.