private ISearchBit Apply(ISearchBit other, Action <OpenBitSet, OpenBitSet> operation) { var bitset = (OpenBitSet)_openBitSet.Clone(); var otherBitSet = other as SearchBit; if (otherBitSet == null) { throw new InvalidOperationException("The other bitset must be of type OpenBitSet"); } operation(bitset, otherBitSet._openBitSet); return(new SearchBit(bitset)); }
/// <inheritdoc /> public ISearchBit Xor(ISearchBit other) { return(Apply(other, (left, right) => left.Xor(right))); }
/// <inheritdoc /> public ISearchBit And(ISearchBit other) { return(Apply(other, (left, right) => left.And(right))); }