@Override public void andNot(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { clearAll(); return; } 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++) { bits[i] &= ~set.bits[i + wordDiff]; } }
@Override public void andNot(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { clearAll(); return; } 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++) { bits[i] &= ~set.bits[i + wordDiff]; } }
@Override public void andNot(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { clearAll(); return; } 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++) { bits[i] &= ~set.bits[i + wordDiff]; } }
/** * Logically XORs this bit set with the specified set of bits. * * @param set the bit set to be XORed with * @throws IllegalArgumentException if set == null */ @Override public final void xor(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { clearAll(); return; } int newOffset = Math.min(offset, set.offset); int newCapacity = Math.max(length(), set.length()) - newOffset; ensureCapacity(newOffset, newCapacity); int wordDiff = wordDiff(newOffset, set.offset); for (int i = 0; i < set.bits.length; i++) { bits[i - wordDiff] ^= set.bits[i]; } }
/** * Logically XORs this bit set with the specified set of bits. * * @param set the bit set to be XORed with * @throws IllegalArgumentException if set == null */ @Override public final void xor(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { clearAll(); return; } int newOffset = Math.min(offset, set.offset); int newCapacity = Math.max(length(), set.length()) - newOffset; ensureCapacity(newOffset, newCapacity); int wordDiff = wordDiff(newOffset, set.offset); for (int i = 0; i < set.bits.length; i++) { bits[i - wordDiff] ^= set.bits[i]; } }
/** * Logically XORs this bit set with the specified set of bits. * * @param set the bit set to be XORed with * @throws IllegalArgumentException if set == null */ @Override public final void xor(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { clearAll(); return; } int newOffset = Math.min(offset, set.offset); int newCapacity = Math.max(length(), set.length()) - newOffset; ensureCapacity(newOffset, newCapacity); int wordDiff = wordDiff(newOffset, set.offset); for (int i = 0; i < set.bits.length; i++) { bits[i - wordDiff] ^= set.bits[i]; } }