Exemplo n.º 1
0
 protected CharClass(BitArray bitArray)
 {
     matches = bitArray;
     if (bitArray.BitCount() > (MatchArraySize >> 1))
     {
         Flip();
     }
 }
Exemplo n.º 2
0
        public bool IsSingleChar(char ch)
        {
            var bitCount = matches.BitCount();

            if (invert)
            {
                return((bitCount == MatchArraySize - 1) && !matches.GetBit(ch));
            }
            else
            {
                return((bitCount == 1) && matches.GetBit(ch));
            }
        }