Package com.ibm.wala.util.intset
Class SemiSparseMutableIntSet
- java.lang.Object
-
- com.ibm.wala.util.intset.SemiSparseMutableIntSet
-
- All Implemented Interfaces:
IntSet,MutableIntSet,Serializable
public class SemiSparseMutableIntSet extends Object implements MutableIntSet
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SemiSparseMutableIntSet()SemiSparseMutableIntSet(SemiSparseMutableIntSet set)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(int i)Add an integer value to this set.booleanaddAll(IntSet set)Add all members of set to this.booleanaddAllInIntersection(IntSet other, IntSet filter)voidclear()remove all elements from this setbooleancontains(int i)booleancontainsAny(IntSet set)voidcopySet(IntSet set)Set the value of this to be the same as the value of setstatic SemiSparseMutableIntSetdiff(SemiSparseMutableIntSet A, SemiSparseMutableIntSet B)voidforeach(IntSetAction action)Invoke an action on each element of the SetvoidforeachExcluding(IntSet X, IntSetAction action)Invoke an action on each element of the Set, excluding elements of Set XIntSetintersection(IntSet that)This implementation must not despoil the original value of "this"voidintersectWith(IntSet set)Interset this with another set.IntIteratorintIterator()booleanisEmpty()booleanisSubset(IntSet that)intmax()booleanremove(int i)Remove an integer from this set.SemiSparseMutableIntSetremoveAll(SemiSparseMutableIntSet B)booleansameValue(IntSet that)intsize()StringtoString()IntSetunion(IntSet that)This implementation must not despoil the original value of "this"
-
-
-
Constructor Detail
-
SemiSparseMutableIntSet
public SemiSparseMutableIntSet()
-
SemiSparseMutableIntSet
public SemiSparseMutableIntSet(SemiSparseMutableIntSet set) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-
Method Detail
-
clear
public void clear()
Description copied from interface:MutableIntSetremove all elements from this set- Specified by:
clearin interfaceMutableIntSet
-
contains
public boolean contains(int i)
-
containsAny
public boolean containsAny(IntSet set)
- Specified by:
containsAnyin interfaceIntSet- Returns:
- true iff this set contains integer i
-
intersection
public IntSet intersection(IntSet that)
This implementation must not despoil the original value of "this"- Specified by:
intersectionin interfaceIntSet- Returns:
- a new IntSet which is the intersection of this and that
-
union
public IntSet union(IntSet that)
Description copied from interface:IntSetThis implementation must not despoil the original value of "this"- Specified by:
unionin interfaceIntSet- Returns:
- a new IntSet containing all elements of this and that
- See Also:
IntSet.union(com.ibm.wala.util.intset.IntSet)
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
intIterator
public IntIterator intIterator()
- Specified by:
intIteratorin interfaceIntSet- Returns:
- a perhaps more efficient iterator
-
foreach
public void foreach(IntSetAction action)
Invoke an action on each element of the Set
-
foreachExcluding
public void foreachExcluding(IntSet X, IntSetAction action)
Invoke an action on each element of the Set, excluding elements of Set X- Specified by:
foreachExcludingin interfaceIntSet
-
max
public int max() throws IllegalStateException- Specified by:
maxin interfaceIntSet- Returns:
- maximum integer in this set.
- Throws:
IllegalStateException
-
sameValue
public boolean sameValue(IntSet that)
- Specified by:
sameValuein interfaceIntSet- Returns:
- true iff
thishas the same value asthat. - Throws:
IllegalArgumentException- if that is null
-
isSubset
public boolean isSubset(IntSet that)
- Specified by:
isSubsetin interfaceIntSet- Returns:
- true iff
thisis a subset ofthat. - Throws:
IllegalArgumentException- if that is null
-
copySet
public void copySet(IntSet set) throws IllegalArgumentException
Set the value of this to be the same as the value of set- Specified by:
copySetin interfaceMutableIntSet- Throws:
IllegalArgumentException- if set == null
-
addAll
public boolean addAll(IntSet set) throws IllegalArgumentException
Add all members of set to this.- Specified by:
addAllin interfaceMutableIntSet- Returns:
- true iff the value of this changes.
- Throws:
IllegalArgumentException- if set == null
-
add
public boolean add(int i)
Add an integer value to this set.- Specified by:
addin interfaceMutableIntSet- Parameters:
i- integer to add- Returns:
- true iff the value of this changes.
-
remove
public boolean remove(int i)
Remove an integer from this set.- Specified by:
removein interfaceMutableIntSet- Parameters:
i- integer to remove- Returns:
- true iff the value of this changes.
-
intersectWith
public void intersectWith(IntSet set)
Interset this with another set.- Specified by:
intersectWithin interfaceMutableIntSet
-
addAllInIntersection
public boolean addAllInIntersection(IntSet other, IntSet filter)
- Specified by:
addAllInIntersectionin interfaceMutableIntSet- Throws:
IllegalArgumentException- if other is null
-
removeAll
public SemiSparseMutableIntSet removeAll(SemiSparseMutableIntSet B)
-
diff
public static SemiSparseMutableIntSet diff(SemiSparseMutableIntSet A, SemiSparseMutableIntSet B)
-
-