示例#1
0
        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));
        }
示例#2
0
 /// <inheritdoc />
 public ISearchBit Xor(ISearchBit other)
 {
     return(Apply(other, (left, right) => left.Xor(right)));
 }
示例#3
0
 /// <inheritdoc />
 public ISearchBit And(ISearchBit other)
 {
     return(Apply(other, (left, right) => left.And(right)));
 }