/** * Compute the asymmetric difference of two sets, a \ b. */ public static IntSet diff(IntSet A, IntSet B, MutableIntSetFactory<?> factory) { if (factory == null) { throw new IllegalArgumentException("null factory"); } if (A == null) { throw new IllegalArgumentException("null A"); } if (B == null) { throw new IllegalArgumentException("null B"); } if (A instanceof SparseIntSet && B instanceof SparseIntSet) { return SparseIntSet.diff((SparseIntSet) A, (SparseIntSet) B); } else if (A instanceof SemiSparseMutableIntSet && B instanceof SemiSparseMutableIntSet) { IntSet d = SemiSparseMutableIntSet.diff((SemiSparseMutableIntSet) A, (SemiSparseMutableIntSet) B); return d; } else { return defaultSlowDiff(A, B, factory); } }
/** * Compute the asymmetric difference of two sets, a \ b. */ public static IntSet diff(IntSet A, IntSet B, MutableIntSetFactory<?> factory) { if (factory == null) { throw new IllegalArgumentException("null factory"); } if (A == null) { throw new IllegalArgumentException("null A"); } if (B == null) { throw new IllegalArgumentException("null B"); } if (A instanceof SparseIntSet && B instanceof SparseIntSet) { return SparseIntSet.diff((SparseIntSet) A, (SparseIntSet) B); } else if (A instanceof SemiSparseMutableIntSet && B instanceof SemiSparseMutableIntSet) { IntSet d = SemiSparseMutableIntSet.diff((SemiSparseMutableIntSet) A, (SemiSparseMutableIntSet) B); return d; } else { return defaultSlowDiff(A, B, factory); } }
/** * Compute the asymmetric difference of two sets, a \ b. */ public static IntSet diff(IntSet A, IntSet B, MutableIntSetFactory<?> factory) { if (factory == null) { throw new IllegalArgumentException("null factory"); } if (A == null) { throw new IllegalArgumentException("null A"); } if (B == null) { throw new IllegalArgumentException("null B"); } if (A instanceof SparseIntSet && B instanceof SparseIntSet) { return SparseIntSet.diff((SparseIntSet) A, (SparseIntSet) B); } else if (A instanceof SemiSparseMutableIntSet && B instanceof SemiSparseMutableIntSet) { IntSet d = SemiSparseMutableIntSet.diff((SemiSparseMutableIntSet) A, (SemiSparseMutableIntSet) B); return d; } else { return defaultSlowDiff(A, B, factory); } }