Package com.ibm.wala.util.intset
Class MutableSharedBitVectorIntSet
- java.lang.Object
-
- com.ibm.wala.util.intset.MutableSharedBitVectorIntSet
-
- All Implemented Interfaces:
IntSet,MutableIntSet,Serializable
public class MutableSharedBitVectorIntSet extends Object implements MutableIntSet
The shared bit vector implementation described by [Heintze 1999] TODO: much optimization possible.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MutableSharedBitVectorIntSet()MutableSharedBitVectorIntSet(BitVectorIntSet s)MutableSharedBitVectorIntSet(MutableSharedBitVectorIntSet set)MutableSharedBitVectorIntSet(SparseIntSet s)
-
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 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 XbooleanhasSharedPart()IntSetintersection(IntSet that)This implementation must not despoil the original value of "this"IntSetintersection(MutableSharedBitVectorIntSet that)voidintersectWith(IntSet set)Intersect this with another set.IntIteratorintIterator()booleanisEmpty()booleanisSubset(IntSet that)intmax()booleanremove(int i)Remove an integer from this set.static booleansameSharedPart(MutableSharedBitVectorIntSet a, MutableSharedBitVectorIntSet b)booleansameValue(IntSet that)intsize()StringtoString()IntSetunion(IntSet that)This implementation must not despoil the original value of "this"
-
-
-
Constructor Detail
-
MutableSharedBitVectorIntSet
public MutableSharedBitVectorIntSet()
-
MutableSharedBitVectorIntSet
public MutableSharedBitVectorIntSet(MutableSharedBitVectorIntSet set)
- Throws:
IllegalArgumentException- if set is null
-
MutableSharedBitVectorIntSet
public MutableSharedBitVectorIntSet(SparseIntSet s)
- Throws:
IllegalArgumentException- if s is null
-
MutableSharedBitVectorIntSet
public MutableSharedBitVectorIntSet(BitVectorIntSet s)
- Throws:
IllegalArgumentException- if s is null
-
-
Method Detail
-
contains
public boolean contains(int i)
- Specified by:
containsin interfaceIntSet- Returns:
- true iff this set contains integer i
- See Also:
IntSet.contains(int)
-
intersection
public IntSet intersection(IntSet that)
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
- See Also:
IntSet.intersection(com.ibm.wala.util.intset.IntSet)
-
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)
-
intersection
public IntSet intersection(MutableSharedBitVectorIntSet that)
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceIntSet- Returns:
- true iff this set is empty
- See Also:
IntSet.isEmpty()
-
size
public int size()
- Specified by:
sizein interfaceIntSet- Returns:
- the number of elements in this set
- See Also:
IntSet.size()
-
intIterator
public IntIterator intIterator()
- Specified by:
intIteratorin interfaceIntSet- Returns:
- a perhaps more efficient iterator
- See Also:
IntSet.intIterator()
-
foreach
public void foreach(IntSetAction action)
Description copied from interface:IntSetInvoke an action on each element of the Set- Specified by:
foreachin interfaceIntSet- See Also:
IntSet.foreach(com.ibm.wala.util.intset.IntSetAction)
-
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- See Also:
IntSet.foreachExcluding(com.ibm.wala.util.intset.IntSet, com.ibm.wala.util.intset.IntSetAction)
-
max
public int max()
- Specified by:
maxin interfaceIntSet- Returns:
- maximum integer in this set.
- See Also:
IntSet.max()
-
sameValue
public boolean sameValue(IntSet that) throws IllegalArgumentException, UnimplementedError
- Specified by:
sameValuein interfaceIntSet- Returns:
- true iff
thishas the same value asthat. - Throws:
IllegalArgumentExceptionUnimplementedError- See Also:
IntSet.sameValue(com.ibm.wala.util.intset.IntSet)
-
isSubset
public boolean isSubset(IntSet that)
- Specified by:
isSubsetin interfaceIntSet- Returns:
- true iff
thisis a subset ofthat. - See Also:
IntSet.isSubset(com.ibm.wala.util.intset.IntSet)
-
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) throws IllegalArgumentException
Description copied from interface:MutableIntSetAdd all members of set to this.- Specified by:
addAllin interfaceMutableIntSet- Returns:
- true iff the value of this changes.
- Throws:
IllegalArgumentException
-
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)
Description copied from interface:MutableIntSetIntersect this with another set.- Specified by:
intersectWithin interfaceMutableIntSet
-
sameSharedPart
public static boolean sameSharedPart(MutableSharedBitVectorIntSet a, MutableSharedBitVectorIntSet b)
-
hasSharedPart
public boolean hasSharedPart()
-
containsAny
public boolean containsAny(IntSet set)
- Specified by:
containsAnyin interfaceIntSet- Returns:
- true iff this set contains integer i
- See Also:
IntSet.containsAny(com.ibm.wala.util.intset.IntSet)
-
addAllInIntersection
public boolean addAllInIntersection(IntSet other, IntSet filter)
- Specified by:
addAllInIntersectionin interfaceMutableIntSet
-
clear
public void clear()
Description copied from interface:MutableIntSetremove all elements from this set- Specified by:
clearin interfaceMutableIntSet
-
-