/** * @return true iff this set is empty */ @Override public boolean isEmpty() { return sparsePart.isEmpty() && (densePart == null || densePart.isZero()); }
/** * @return true iff this set is empty */ @Override public boolean isEmpty() { return sparsePart.isEmpty() && (densePart == null || densePart.isZero()); }
/** * @return true iff this set is empty */ @Override public boolean isEmpty() { return sparsePart.isEmpty() && (densePart == null || densePart.isZero()); }
/** * Check if the intersection of the two sets is empty * * @param set the set to check intersection with * @throws IllegalArgumentException if set == null */ @Override public final boolean intersectionEmpty(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { return isZero(); } int wordDiff = wordDiff(offset, set.offset); int maxWord = Math.min(bits.length, set.bits.length - wordDiff); int i = Math.max(0, -wordDiff); for (; i < maxWord; i++) { if ((bits[i] & set.bits[i + wordDiff]) != 0) { return false; } } return true; }
/** * Check if the intersection of the two sets is empty * * @param set the set to check intersection with * @throws IllegalArgumentException if set == null */ @Override public final boolean intersectionEmpty(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { return isZero(); } int wordDiff = wordDiff(offset, set.offset); int maxWord = Math.min(bits.length, set.bits.length - wordDiff); int i = Math.max(0, -wordDiff); for (; i < maxWord; i++) { if ((bits[i] & set.bits[i + wordDiff]) != 0) { return false; } } return true; }
/** * Check if the intersection of the two sets is empty * * @param set the set to check intersection with * @throws IllegalArgumentException if set == null */ @Override public final boolean intersectionEmpty(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { return isZero(); } int wordDiff = wordDiff(offset, set.offset); int maxWord = Math.min(bits.length, set.bits.length - wordDiff); int i = Math.max(0, -wordDiff); for (; i < maxWord; i++) { if ((bits[i] & set.bits[i + wordDiff]) != 0) { return false; } } return true; }