/** * Logically ORs this bit set with the specified set of bits. * * @param set the bit set to be ORed with * @throws IllegalArgumentException if set == null */ @Override public final void or(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { // should help alias analysis 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 ORs this bit set with the specified set of bits. * * @param set the bit set to be ORed with * @throws IllegalArgumentException if set == null */ @Override public final void or(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { // should help alias analysis 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 ORs this bit set with the specified set of bits. * * @param set the bit set to be ORed with * @throws IllegalArgumentException if set == null */ @Override public final void or(OffsetBitVector set) throws IllegalArgumentException { if (set == null) { throw new IllegalArgumentException("set == null"); } if (this == set) { // should help alias analysis 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]; } }
/** * 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]; } }