Class LongSetUtil


  • public class LongSetUtil
    extends java.lang.Object
    Utilities for dealing with LongSets
    • 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
    • Constructor Detail

      • LongSetUtil

        public LongSetUtil()
    • Method Detail

      • 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.
      • 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
      • setDefaultLongSetFactory

        public static void setDefaultLongSetFactory​(MutableLongSetFactory defaultLongSetFactory)
      • add

        public static LongSet add​(LongSet s,
                                  int j)
                           throws java.lang.IllegalArgumentException
        Returns:
        a new sparse int set which adds j to s
        Throws:
        java.lang.IllegalArgumentException - if s == null