Package com.ibm.wala.util.intset
Class BimodalMutableIntSet
- java.lang.Object
-
- com.ibm.wala.util.intset.BimodalMutableIntSet
-
- All Implemented Interfaces:
IntSet,MutableIntSet,java.io.Serializable
public class BimodalMutableIntSet extends java.lang.Object implements MutableIntSet
An implementation ofMutableIntSetthat delegates to either aMutableSparseIntSetor aBitVectorIntSet- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BimodalMutableIntSet()BimodalMutableIntSet(int initialSize, float expansionFactor)BimodalMutableIntSet(BimodalMutableIntSet x)
-
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)booleancontainsAll(BimodalMutableIntSet that)TODO: optimize ME!booleancontainsAny(IntSet that)voidcopySet(IntSet set)Set the value of this to be the same as the value of setvoidforeach(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 XIntSetgetBackingStore()use with careIntSetintersection(IntSet that)This implementation must not despoil the original value of "this"voidintersectWith(IntSet set)Intersect this with another set.IntIteratorintIterator()booleanisEmpty()booleanisSubset(IntSet that)static BimodalMutableIntSetmakeCopy(IntSet B)intmax()booleanremove(int i)Remove an integer from this set.booleanremoveAll(IntSet that)TODO: optimize ME!booleansameValue(IntSet that)intsize()java.lang.StringtoString()IntSetunion(IntSet that)This implementation must not despoil the original value of "this"
-
-
-
Constructor Detail
-
BimodalMutableIntSet
public BimodalMutableIntSet()
-
BimodalMutableIntSet
public BimodalMutableIntSet(int initialSize, float expansionFactor)
-
BimodalMutableIntSet
public BimodalMutableIntSet(BimodalMutableIntSet x)
- Throws:
java.lang.IllegalArgumentException- if x is null
-
-
Method Detail
-
copySet
public void copySet(IntSet set)
Description copied from interface:MutableIntSetSet the value of this to be the same as the value of set- Specified by:
copySetin interfaceMutableIntSet
-
addAll
public boolean addAll(IntSet set)
Description copied from interface:MutableIntSetAdd all members of set to this.- Specified by:
addAllin interfaceMutableIntSet- Returns:
- true iff the value of this changes.
-
addAllInIntersection
public boolean addAllInIntersection(IntSet other, IntSet filter)
- Specified by:
addAllInIntersectionin interfaceMutableIntSet
-
add
public boolean add(int i)
Description copied from interface:MutableIntSetAdd 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)
Description copied from interface:MutableIntSetRemove 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) throws UnimplementedError
Description copied from interface:MutableIntSetIntersect this with another set.- Specified by:
intersectWithin interfaceMutableIntSet- Throws:
UnimplementedError
-
contains
public boolean contains(int i)
-
intersection
public IntSet intersection(IntSet that) throws UnimplementedError
Description copied from interface:IntSetThis 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
- Throws:
UnimplementedError
-
union
public IntSet union(IntSet that)
Description copied from interface:IntSetThis implementation must not despoil the original value of "this"
-
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)
Description copied from interface:IntSetInvoke an action on each element of the Set
-
foreachExcluding
public void foreachExcluding(IntSet X, IntSetAction action)
Description copied from interface:IntSetInvoke an action on each element of the Set, excluding elements of Set X- Specified by:
foreachExcludingin interfaceIntSet
-
max
public int max() throws java.lang.IllegalStateException
-
makeCopy
public static BimodalMutableIntSet makeCopy(IntSet B) throws UnimplementedError, java.lang.IllegalArgumentException
- Throws:
UnimplementedErrorjava.lang.IllegalArgumentException
-
clear
public void clear()
Description copied from interface:MutableIntSetremove all elements from this set- Specified by:
clearin interfaceMutableIntSet
-
sameValue
public boolean sameValue(IntSet that)
-
isSubset
public boolean isSubset(IntSet that) throws java.lang.IllegalArgumentException
-
getBackingStore
public IntSet getBackingStore()
use with care
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
containsAny
public boolean containsAny(IntSet that) throws java.lang.IllegalArgumentException, UnimplementedError
- Specified by:
containsAnyin interfaceIntSet- Returns:
- true iff this set contains integer i
- Throws:
java.lang.IllegalArgumentExceptionUnimplementedError
-
removeAll
public boolean removeAll(IntSet that)
TODO: optimize ME!- Throws:
java.lang.IllegalArgumentException- if that is null
-
containsAll
public boolean containsAll(BimodalMutableIntSet that)
TODO: optimize ME!- Throws:
java.lang.IllegalArgumentException- if that is null
-
-