Package com.ibm.wala.util.intset
Class LongSetUtil
java.lang.Object
com.ibm.wala.util.intset.LongSetUtil
Utilities for dealing with LongSets
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LongSet
static int
binarySearch
(long[] data, long key, int low, int high) static LongSet
Compute the asymmetric difference of two sets, a \ b.static LongSet
diff
(LongSet A, LongSet B, MutableLongSetFactory factory) Compute the asymmetric difference of two sets, a \ b.static MutableLongSetFactory
static MutableLongSet
make()
static MutableLongSet
makeMutableCopy
(LongSet set) This method constructs an appropriate mutable copy of set.static MutableLongSet
removeAll
(MutableLongSet A, LongSet B) Subtract two sets, i.e.static void
setDefaultLongSetFactory
(MutableLongSetFactory defaultLongSetFactory)
-
Field Details
-
INT_SET_FACTORY_CONFIG_PROPERTY_NAME
- See Also:
-
-
Constructor Details
-
LongSetUtil
public LongSetUtil()
-
-
Method Details
-
make
-
makeMutableCopy
public static MutableLongSet makeMutableCopy(LongSet set) throws IllegalArgumentException, UnimplementedError This method constructs an appropriate mutable copy of set.- Returns:
- a new MutableLongSet object with the same value as set
- Throws:
UnimplementedError
- if (not ( set instanceof com.ibm.wala.util.intset.SparseLongSet ) ) and (not ( set instanceof com.ibm.wala.util.intset.BitVectorLongSet ) ) and (not ( set instanceof com.ibm.wala.util.intset.BimodalMutableLongSet ) ) and (not ( set instanceof com.ibm.wala.util.intset.DebuggingMutableLongSet ) ) and (not ( set instanceof com.ibm.wala.util.intset.SemiSparseMutableLongSet ) ) and (not ( set instanceof com.ibm.wala.util.intset.MutableSharedBitVectorLongSet ) )IllegalArgumentException
- if set == null
-
diff
Compute the asymmetric difference of two sets, a \ b. -
diff
Compute the asymmetric difference of two sets, a \ b. -
removeAll
Subtract two sets, i.e. a = a \ b.- Throws:
IllegalArgumentException
- if A == null || B == null
-
binarySearch
public static int binarySearch(long[] data, long key, int low, int high) throws IllegalArgumentException - Returns:
- index \in [low,high] s.t. data[index] = key, or -1 if not found
- Throws:
IllegalArgumentException
-
getDefaultLongSetFactory
-
setDefaultLongSetFactory
-
add
- Returns:
- a new sparse int set which adds j to s
- Throws:
IllegalArgumentException
- if s == null
-