/** * Compute the asymmetric difference of two sets, a \ b. */ public static IntSet diff(IntSet A, IntSet B) { if (A == null) { throw new IllegalArgumentException("null A"); } if (B == null) { throw new IllegalArgumentException("null B"); } return diff(A, B, IntSetUtil.getDefaultIntSetFactory()); }
/** * Compute the asymmetric difference of two sets, a \ b. */ public static IntSet diff(IntSet A, IntSet B) { if (A == null) { throw new IllegalArgumentException("null A"); } if (B == null) { throw new IllegalArgumentException("null B"); } return diff(A, B, IntSetUtil.getDefaultIntSetFactory()); }
/** * Compute the asymmetric difference of two sets, a \ b. */ public static IntSet diff(IntSet A, IntSet B) { if (A == null) { throw new IllegalArgumentException("null A"); } if (B == null) { throw new IllegalArgumentException("null B"); } return diff(A, B, IntSetUtil.getDefaultIntSetFactory()); }
/** * Keep this method private .. this returns the actual backing set for the class, which we do not want to expose to clients. */ private MutableIntSet findOrCreateSparseSetForClass(IClass klass) { assert klass.getReference() != TypeReference.JavaLangObject; MutableIntSet result = class2InstanceKey.get(klass); if (result == null) { result = IntSetUtil.getDefaultIntSetFactory().make(); class2InstanceKey.put(klass, result); } return result; }
/** * Keep this method private .. this returns the actual backing set for the class, which we do not want to expose to clients. */ private MutableIntSet findOrCreateSparseSetForClass(IClass klass) { assert klass.getReference() != TypeReference.JavaLangObject; MutableIntSet result = class2InstanceKey.get(klass); if (result == null) { result = IntSetUtil.getDefaultIntSetFactory().make(); class2InstanceKey.put(klass, result); } return result; }
/** * @return a set of integers representing the instance keys that correspond to a given class. This method creates a new set, which * the caller may bash at will. */ MutableIntSet cloneInstanceKeysForClass(IClass klass) { assert klass.getReference() != TypeReference.JavaLangObject; MutableIntSet set = class2InstanceKey.get(klass); if (set == null) { return IntSetUtil.getDefaultIntSetFactory().make(); } else { // return a copy. return IntSetUtil.getDefaultIntSetFactory().makeCopy(set); } }
/** * @return a set of integers representing the instance keys that correspond to a given class. This method creates a new set, which * the caller may bash at will. */ MutableIntSet cloneInstanceKeysForClass(IClass klass) { assert klass.getReference() != TypeReference.JavaLangObject; MutableIntSet set = class2InstanceKey.get(klass); if (set == null) { return IntSetUtil.getDefaultIntSetFactory().make(); } else { // return a copy. return IntSetUtil.getDefaultIntSetFactory().makeCopy(set); } }
/** * Set a particular bit * * @param b the bit to set */ public boolean add(int b) { if (V == null) { V = IntSetUtil.getDefaultIntSetFactory().make(); } return V.add(b); }
/** * Set a particular bit * * @param b the bit to set */ public boolean add(int b) { if (V == null) { V = IntSetUtil.getDefaultIntSetFactory().make(); } return V.add(b); }
/** * Set a particular bit * * @param b the bit to set */ public boolean add(int b) { if (V == null) { V = IntSetUtil.getDefaultIntSetFactory().make(); } return V.add(b); }
@Override public void copyState(T other) { if (V == null) { if (other.V == null) { return; } else { V = IntSetUtil.getDefaultIntSetFactory().makeCopy(other.V); return; } } else { if (other.V != null) { V.copySet(other.V); } } }
@Override public void copyState(T other) { if (V == null) { if (other.V == null) { return; } else { V = IntSetUtil.getDefaultIntSetFactory().makeCopy(other.V); return; } } else { if (other.V != null) { V.copySet(other.V); } } }
@Override public void copyState(T other) { if (V == null) { if (other.V == null) { return; } else { V = IntSetUtil.getDefaultIntSetFactory().makeCopy(other.V); return; } } else { if (other.V != null) { V.copySet(other.V); } } }
/** * Add all integers from the set B * * @return true iff the value of this changes */ public boolean addAll(IntSet B) { if (V == null) { V = IntSetUtil.getDefaultIntSetFactory().makeCopy(B); return (B.size() > 0); } else { boolean result = V.addAll(B); return result; } }
/** * Add all integers from the set B * * @return true iff the value of this changes */ public boolean addAll(IntSet B) { if (V == null) { V = IntSetUtil.getDefaultIntSetFactory().makeCopy(B); return (B.size() > 0); } else { boolean result = V.addAll(B); return result; } }
/** * Add all integers from the set B * * @return true iff the value of this changes */ public boolean addAll(IntSet B) { if (V == null) { V = IntSetUtil.getDefaultIntSetFactory().makeCopy(B); return (B.size() > 0); } else { boolean result = V.addAll(B); return result; } }
public boolean addAllInIntersection(IntSet other, IntSet filter) { if (V == null) { V = IntSetUtil.getDefaultIntSetFactory().makeCopy(other); V.intersectWith(filter); if (V.isEmpty()) { V = null; } return (V != null); } else { boolean result = V.addAllInIntersection(other, filter); return result; } }
public boolean addAllInIntersection(IntSet other, IntSet filter) { if (V == null) { V = IntSetUtil.getDefaultIntSetFactory().makeCopy(other); V.intersectWith(filter); if (V.isEmpty()) { V = null; } return (V != null); } else { boolean result = V.addAllInIntersection(other, filter); return result; } }
public boolean addAllInIntersection(IntSet other, IntSet filter) { if (V == null) { V = IntSetUtil.getDefaultIntSetFactory().makeCopy(other); V.intersectWith(filter); if (V.isEmpty()) { V = null; } return (V != null); } else { boolean result = V.addAllInIntersection(other, filter); return result; } }
private void runBitsetTest(MutableIntSetFactory<?> p, MutableIntSetFactory<?> s) throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException { MutableIntSetFactory<?> save = IntSetUtil.getDefaultIntSetFactory(); try { IntSetUtil.setDefaultIntSetFactory(new DebuggingMutableIntSetFactory(p, s)); graphTest.testJLex(); } finally { IntSetUtil.setDefaultIntSetFactory(save); } }