Package com.ibm.wala.util.intset
Class LongSetUtil
- java.lang.Object
-
- com.ibm.wala.util.intset.LongSetUtil
-
public class LongSetUtil extends Object
Utilities for dealing with LongSets
-
-
Field Summary
Fields Modifier and Type Field Description static StringINT_SET_FACTORY_CONFIG_PROPERTY_NAME
-
Constructor Summary
Constructors Constructor Description LongSetUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LongSetadd(LongSet s, int j)static intbinarySearch(long[] data, long key, int low, int high)static LongSetdiff(LongSet A, LongSet B)Compute the asymmetric difference of two sets, a \ b.static LongSetdiff(LongSet A, LongSet B, @Nullable MutableLongSetFactory factory)Compute the asymmetric difference of two sets, a \ b.static @Nullable MutableLongSetFactorygetDefaultLongSetFactory()static MutableLongSetmake()static @Nullable MutableLongSetmakeMutableCopy(LongSet set)This method constructs an appropriate mutable copy of set.static MutableLongSetremoveAll(MutableLongSet A, LongSet B)Subtract two sets, i.e.static voidsetDefaultLongSetFactory(MutableLongSetFactory defaultLongSetFactory)
-
-
-
Field Detail
-
INT_SET_FACTORY_CONFIG_PROPERTY_NAME
public static final String INT_SET_FACTORY_CONFIG_PROPERTY_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
make
@NullUnmarked public static MutableLongSet make()
-
makeMutableCopy
public static @Nullable 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
public static LongSet diff(LongSet A, LongSet B)
Compute the asymmetric difference of two sets, a \ b.
-
diff
public static LongSet diff(LongSet A, LongSet B, @Nullable MutableLongSetFactory factory)
Compute the asymmetric difference of two sets, a \ b.
-
removeAll
public static MutableLongSet removeAll(MutableLongSet A, LongSet B) throws IllegalArgumentException
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
public static @Nullable MutableLongSetFactory getDefaultLongSetFactory()
-
setDefaultLongSetFactory
public static void setDefaultLongSetFactory(MutableLongSetFactory defaultLongSetFactory)
-
add
public static LongSet add(LongSet s, int j) throws IllegalArgumentException
- Returns:
- a new sparse int set which adds j to s
- Throws:
IllegalArgumentException- if s == null
-
-