Package com.ibm.wala.util.intset
Class IntSetUtil
- java.lang.Object
-
- com.ibm.wala.util.intset.IntSetUtil
-
-
Field Summary
Fields Modifier and Type Field Description static StringINT_SET_FACTORY_CONFIG_PROPERTY_NAME
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IntSetadd(IntSet s, int j)static intbinarySearch(int[] data, int key, int low, int high)static IntSetdiff(IntSet A, IntSet B)Compute the asymmetric difference of two sets, a \ b.static IntSetdiff(IntSet A, IntSet B, MutableIntSetFactory<?> factory)Compute the asymmetric difference of two sets, a \ b.static MutableIntSetFactory<?>getDefaultIntSetFactory()static MutableIntSetmake()static MutableIntSetmake(int[] initial)static IntSetmake(Set<Integer> x)static MutableIntSetmakeMutableCopy(IntSet set)This method constructs an appropriate mutable copy of set.static MutableIntSetremoveAll(MutableIntSet A, IntSet B)Subtract two sets, i.e.static voidsetDefaultIntSetFactory(MutableIntSetFactory<?> defaultIntSetFactory)static int[]toArray(IntSet s)
-
-
-
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
public static MutableIntSet make()
-
make
public static MutableIntSet make(int[] initial)
-
makeMutableCopy
@NullUnmarked public static MutableIntSet makeMutableCopy(IntSet set) throws IllegalArgumentException, UnimplementedError
This method constructs an appropriate mutable copy of set.- Returns:
- a new
MutableIntSetobject with the same value as set - Throws:
UnimplementedError- if we haven't supported the set type yet.IllegalArgumentException- if set == null
-
diff
public static IntSet diff(IntSet A, IntSet B)
Compute the asymmetric difference of two sets, a \ b.
-
diff
public static IntSet diff(IntSet A, IntSet B, MutableIntSetFactory<?> factory)
Compute the asymmetric difference of two sets, a \ b.
-
removeAll
public static MutableIntSet removeAll(MutableIntSet A, IntSet B) throws IllegalArgumentException
Subtract two sets, i.e. a = a \ b.- Throws:
IllegalArgumentException- if B == null
-
binarySearch
public static int binarySearch(int[] data, int key, int low, int high) throws IllegalArgumentException- Returns:
- index \in [low,high] s.t. data[index] = key, or -1 if not found
- Throws:
IllegalArgumentException
-
getDefaultIntSetFactory
public static MutableIntSetFactory<?> getDefaultIntSetFactory()
- Returns:
- Returns the defaultIntSetFactory.
-
setDefaultIntSetFactory
public static void setDefaultIntSetFactory(MutableIntSetFactory<?> defaultIntSetFactory)
- Parameters:
defaultIntSetFactory- The defaultIntSetFactory to set.
-
add
public static IntSet add(IntSet s, int j) throws IllegalArgumentException
- Returns:
- a new sparse int set which adds j to s
- Throws:
IllegalArgumentException- if s == null
-
toArray
public static int[] toArray(IntSet s)
-
-