Package com.ibm.wala.util.intset
Class MutableSharedBitVectorIntSet
- java.lang.Object
-
- com.ibm.wala.util.intset.MutableSharedBitVectorIntSet
-
- All Implemented Interfaces:
IntSet
,MutableIntSet
,java.io.Serializable
public class MutableSharedBitVectorIntSet extends java.lang.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 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 setboolean
contains(int i)
boolean
containsAny(IntSet set)
void
copySet(IntSet set)
Set the value of this to be the same as the value of setvoid
foreach(IntSetAction action)
Invoke an action on each element of the Setvoid
foreachExcluding(IntSet X, IntSetAction action)
Invoke an action on each element of the Set, excluding elements of Set Xboolean
hasSharedPart()
IntSet
intersection(IntSet that)
This implementation must not despoil the original value of "this"IntSet
intersection(MutableSharedBitVectorIntSet that)
void
intersectWith(IntSet set)
Intersect this with another set.IntIterator
intIterator()
boolean
isEmpty()
boolean
isSubset(IntSet that)
int
max()
boolean
remove(int i)
Remove an integer from this set.static boolean
sameSharedPart(MutableSharedBitVectorIntSet a, MutableSharedBitVectorIntSet b)
boolean
sameValue(IntSet that)
int
size()
java.lang.String
toString()
IntSet
union(IntSet that)
This implementation must not despoil the original value of "this"
-
-
-
Constructor Detail
-
MutableSharedBitVectorIntSet
public MutableSharedBitVectorIntSet()
-
MutableSharedBitVectorIntSet
public MutableSharedBitVectorIntSet(MutableSharedBitVectorIntSet set)
- Throws:
java.lang.IllegalArgumentException
- if set is null
-
MutableSharedBitVectorIntSet
public MutableSharedBitVectorIntSet(SparseIntSet s)
- Throws:
java.lang.IllegalArgumentException
- if s is null
-
MutableSharedBitVectorIntSet
public MutableSharedBitVectorIntSet(BitVectorIntSet s)
- Throws:
java.lang.IllegalArgumentException
- if s is null
-
-
Method Detail
-
contains
public boolean contains(int i)
-
intersection
public IntSet intersection(IntSet that)
Description copied from interface:IntSet
This implementation must not despoil the original value of "this"- Specified by:
intersection
in interfaceIntSet
- Returns:
- a new IntSet which is the intersection of this and that
-
union
public IntSet union(IntSet that)
Description copied from interface:IntSet
This implementation must not despoil the original value of "this"
-
intersection
public IntSet intersection(MutableSharedBitVectorIntSet that)
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
intIterator
public IntIterator intIterator()
- Specified by:
intIterator
in interfaceIntSet
- Returns:
- a perhaps more efficient iterator
-
foreach
public void foreach(IntSetAction action)
Description copied from interface:IntSet
Invoke an action on each element of the Set
-
foreachExcluding
public void foreachExcluding(IntSet X, IntSetAction action)
Description copied from interface:IntSet
Invoke an action on each element of the Set, excluding elements of Set X- Specified by:
foreachExcluding
in interfaceIntSet
-
sameValue
public boolean sameValue(IntSet that) throws java.lang.IllegalArgumentException, UnimplementedError
- Specified by:
sameValue
in interfaceIntSet
- Returns:
- true iff
this
has the same value asthat
. - Throws:
java.lang.IllegalArgumentException
UnimplementedError
-
isSubset
public boolean isSubset(IntSet that)
-
copySet
public void copySet(IntSet set)
Description copied from interface:MutableIntSet
Set the value of this to be the same as the value of set- Specified by:
copySet
in interfaceMutableIntSet
-
addAll
public boolean addAll(IntSet set) throws java.lang.IllegalArgumentException
Description copied from interface:MutableIntSet
Add all members of set to this.- Specified by:
addAll
in interfaceMutableIntSet
- Returns:
- true iff the value of this changes.
- Throws:
java.lang.IllegalArgumentException
-
add
public boolean add(int i)
Description copied from interface:MutableIntSet
Add an integer value to this set.- Specified by:
add
in interfaceMutableIntSet
- Parameters:
i
- integer to add- Returns:
- true iff the value of this changes.
-
remove
public boolean remove(int i)
Description copied from interface:MutableIntSet
Remove an integer from this set.- Specified by:
remove
in interfaceMutableIntSet
- Parameters:
i
- integer to remove- Returns:
- true iff the value of this changes.
-
intersectWith
public void intersectWith(IntSet set)
Description copied from interface:MutableIntSet
Intersect this with another set.- Specified by:
intersectWith
in interfaceMutableIntSet
-
sameSharedPart
public static boolean sameSharedPart(MutableSharedBitVectorIntSet a, MutableSharedBitVectorIntSet b)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hasSharedPart
public boolean hasSharedPart()
-
containsAny
public boolean containsAny(IntSet set)
- Specified by:
containsAny
in interfaceIntSet
- Returns:
- true iff this set contains integer i
-
addAllInIntersection
public boolean addAllInIntersection(IntSet other, IntSet filter)
- Specified by:
addAllInIntersection
in interfaceMutableIntSet
-
clear
public void clear()
Description copied from interface:MutableIntSet
remove all elements from this set- Specified by:
clear
in interfaceMutableIntSet
-
-