Package com.ibm.wala.util.intset
Class LongSetUtil
- java.lang.Object
-
- com.ibm.wala.util.intset.LongSetUtil
-
public class LongSetUtil extends java.lang.Object
Utilities for dealing with LongSets
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INT_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 LongSet
add(LongSet s, int j)
static int
binarySearch(long[] data, long key, int low, int high)
static LongSet
diff(LongSet A, LongSet B)
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
getDefaultLongSetFactory()
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 Detail
-
INT_SET_FACTORY_CONFIG_PROPERTY_NAME
public static final java.lang.String INT_SET_FACTORY_CONFIG_PROPERTY_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
make
public static MutableLongSet make()
-
makeMutableCopy
public static MutableLongSet makeMutableCopy(LongSet set) throws java.lang.IllegalArgumentException, UnimplementedError
This method constructs an appropriate mutable copy of set.- Parameters:
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 ) )java.lang.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, MutableLongSetFactory factory)
Compute the asymmetric difference of two sets, a \ b.
-
removeAll
public static MutableLongSet removeAll(MutableLongSet A, LongSet B) throws java.lang.IllegalArgumentException
Subtract two sets, i.e. a = a \ b.- Throws:
java.lang.IllegalArgumentException
- if A == null || B == null
-
binarySearch
public static int binarySearch(long[] data, long key, int low, int high) throws java.lang.IllegalArgumentException
- Returns:
- index \in [low,high] s.t. data[index] = key, or -1 if not found
- Throws:
java.lang.IllegalArgumentException
-
getDefaultLongSetFactory
public static MutableLongSetFactory getDefaultLongSetFactory()
-
setDefaultLongSetFactory
public static void setDefaultLongSetFactory(MutableLongSetFactory defaultLongSetFactory)
-
-