public class SemiSparseMutableIntSet extends Object implements MutableIntSet
Constructor and Description |
---|
SemiSparseMutableIntSet() |
SemiSparseMutableIntSet(SemiSparseMutableIntSet set) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(int i)
Add an integer value to this set.
|
boolean |
addAll(IntSet set)
Add all members of set to this.
|
boolean |
addAllInIntersection(IntSet other,
IntSet filter) |
void |
clear()
remove all elements from this set
|
boolean |
contains(int i) |
boolean |
containsAny(IntSet set) |
void |
copySet(IntSet set)
Set the value of this to be the same as the value of set
|
static SemiSparseMutableIntSet |
diff(SemiSparseMutableIntSet A,
SemiSparseMutableIntSet B) |
void |
foreach(IntSetAction action)
Invoke an action on each element of the Set
|
void |
foreachExcluding(IntSet X,
IntSetAction action)
Invoke an action on each element of the Set, excluding elements of Set X
|
IntSet |
intersection(IntSet that)
This implementation must not despoil the original value of "this"
|
void |
intersectWith(IntSet set)
Interset this with another set.
|
IntIterator |
intIterator() |
boolean |
isEmpty() |
boolean |
isSubset(IntSet that) |
int |
max() |
boolean |
remove(int i)
Remove an integer from this set.
|
SemiSparseMutableIntSet |
removeAll(SemiSparseMutableIntSet B) |
boolean |
sameValue(IntSet that) |
int |
size() |
String |
toString() |
IntSet |
union(IntSet that)
This implementation must not despoil the original value of "this"
|
public SemiSparseMutableIntSet()
public SemiSparseMutableIntSet(SemiSparseMutableIntSet set) throws IllegalArgumentException
IllegalArgumentException
public void clear()
MutableIntSet
clear
in interface MutableIntSet
public boolean contains(int i)
public boolean containsAny(IntSet set)
containsAny
in interface IntSet
public IntSet intersection(IntSet that)
intersection
in interface IntSet
public IntSet union(IntSet that)
IntSet
public boolean isEmpty()
public int size()
public IntIterator intIterator()
intIterator
in interface IntSet
public void foreach(IntSetAction action)
public void foreachExcluding(IntSet X, IntSetAction action)
foreachExcluding
in interface IntSet
action
- public int max() throws IllegalStateException
max
in interface IntSet
IllegalStateException
public boolean sameValue(IntSet that)
sameValue
in interface IntSet
this
has the same value as that
.IllegalArgumentException
- if that is nullpublic boolean isSubset(IntSet that)
isSubset
in interface IntSet
this
is a subset of that
.IllegalArgumentException
- if that is nullpublic void copySet(IntSet set) throws IllegalArgumentException
copySet
in interface MutableIntSet
IllegalArgumentException
- if set == nullpublic boolean addAll(IntSet set) throws IllegalArgumentException
addAll
in interface MutableIntSet
IllegalArgumentException
- if set == nullpublic boolean add(int i)
add
in interface MutableIntSet
i
- integer to addpublic boolean remove(int i)
remove
in interface MutableIntSet
i
- integer to removepublic void intersectWith(IntSet set)
intersectWith
in interface MutableIntSet
set
- public boolean addAllInIntersection(IntSet other, IntSet filter)
addAllInIntersection
in interface MutableIntSet
IllegalArgumentException
- if other is nullpublic SemiSparseMutableIntSet removeAll(SemiSparseMutableIntSet B)
public static SemiSparseMutableIntSet diff(SemiSparseMutableIntSet A, SemiSparseMutableIntSet B)