/** * Add all elements from another int set. * * @return true iff this set changes */ public boolean addAll(SparseIntSet that) { if (that == null) { throw new IllegalArgumentException("null that"); } if (this.isEmpty()) { copySet(that); return !that.isEmpty(); } else if (that.isEmpty()) { return false; } else if (this.equals(that)) { return false; } // common-case optimization if (that.size == 1) { boolean result = add(that.elements[0]); return result; } int[] br = that.elements; int bl = that.size(); return addAll(br, bl); }
/** * Add all elements from another int set. * * @return true iff this set changes */ public boolean addAll(SparseIntSet that) { if (that == null) { throw new IllegalArgumentException("null that"); } if (this.isEmpty()) { copySet(that); return !that.isEmpty(); } else if (that.isEmpty()) { return false; } else if (this.equals(that)) { return false; } // common-case optimization if (that.size == 1) { boolean result = add(that.elements[0]); return result; } int[] br = that.elements; int bl = that.size(); return addAll(br, bl); }
/** * Add all elements from another int set. * * @return true iff this set changes */ public boolean addAll(SparseIntSet that) { if (that == null) { throw new IllegalArgumentException("null that"); } if (this.isEmpty()) { copySet(that); return !that.isEmpty(); } else if (that.isEmpty()) { return false; } else if (this.equals(that)) { return false; } // common-case optimization if (that.size == 1) { boolean result = add(that.elements[0]); return result; } int[] br = that.elements; int bl = that.size(); return addAll(br, bl); }
if (this.isEmpty()) { return; } else if (that.isEmpty()) { elements = null; size = 0;
if (this.isEmpty()) { return; } else if (that.isEmpty()) { elements = null; size = 0;
if (this.isEmpty()) { return; } else if (that.isEmpty()) { elements = null; size = 0;
private boolean addAllInternal(SparseIntSet set) { if (privatePart == null) { if (sharedPart == null) { if (!set.isEmpty()) { privatePart = MutableSparseIntSet.make(set); sharedPart = null;
private boolean addAllInternal(SparseIntSet set) { if (privatePart == null) { if (sharedPart == null) { if (!set.isEmpty()) { privatePart = MutableSparseIntSet.make(set); sharedPart = null;
private boolean addAllInternal(SparseIntSet set) { if (privatePart == null) { if (sharedPart == null) { if (!set.isEmpty()) { privatePart = MutableSparseIntSet.make(set); sharedPart = null;