/** */ private boolean sameValueInternal(SparseIntSet that) { populationCount = (populationCount == UNDEFINED) ? bitVector.populationCount() : populationCount; if (populationCount != that.size()) { return false; } for (int i = 0; i < that.size(); i++) { int val = that.elementAt(i); if (!bitVector.contains(val)) { return false; } } return true; }
/** */ private boolean sameValueInternal(SparseIntSet that) { populationCount = (populationCount == UNDEFINED) ? bitVector.populationCount() : populationCount; if (populationCount != that.size()) { return false; } for (int i = 0; i < that.size(); i++) { int val = that.elementAt(i); if (!bitVector.contains(val)) { return false; } } return true; }
/** */ private boolean sameValueInternal(SparseIntSet that) { populationCount = (populationCount == UNDEFINED) ? bitVector.populationCount() : populationCount; if (populationCount != that.size()) { return false; } for (int i = 0; i < that.size(); i++) { int val = that.elementAt(i); if (!bitVector.contains(val)) { return false; } } return true; }
/** * @throws IllegalArgumentException if s is null */ public MutableSharedBitVectorIntSet(SparseIntSet s) { if (s == null) { throw new IllegalArgumentException("s is null"); } if (s.size() == 0) { return; } this.privatePart = MutableSparseIntSet.make(s); checkOverflow(); if (PARANOID) { checkIntegrity(); } }
/** * @throws IllegalArgumentException if s is null */ public MutableSharedBitVectorIntSet(SparseIntSet s) { if (s == null) { throw new IllegalArgumentException("s is null"); } if (s.size() == 0) { return; } this.privatePart = MutableSparseIntSet.make(s); checkOverflow(); if (PARANOID) { checkIntegrity(); } }
/** * @throws IllegalArgumentException if s is null */ public MutableSharedBitVectorIntSet(SparseIntSet s) { if (s == null) { throw new IllegalArgumentException("s is null"); } if (s.size() == 0) { return; } this.privatePart = MutableSparseIntSet.make(s); checkOverflow(); if (PARANOID) { checkIntegrity(); } }
private boolean sameValue(SparseIntSet that) { if (size() != that.size()) { return false; } if (sharedPart == null) { if (privatePart == null) /* both parts empty, and that has same (i.e. 0) size */ return true; else return privatePart.sameValue(that); } else { /* sharedPart != null */ return makeSparseCopy().sameValue(that); } }
private boolean sameValue(SparseIntSet that) { if (size() != that.size()) { return false; } if (sharedPart == null) { if (privatePart == null) /* both parts empty, and that has same (i.e. 0) size */ return true; else return privatePart.sameValue(that); } else { /* sharedPart != null */ return makeSparseCopy().sameValue(that); } }
private boolean sameValue(SparseIntSet that) { if (size() != that.size()) { return false; } if (sharedPart == null) { if (privatePart == null) /* both parts empty, and that has same (i.e. 0) size */ return true; else return privatePart.sameValue(that); } else { /* sharedPart != null */ return makeSparseCopy().sameValue(that); } }
/** * 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); }