public bool Evaluate(LongByte key) { int i = 0; foreach (int _ in LongByte.GetSetBits(key.Value & Key.Value, true)) { if (++i == 2) { return(false); } } return(true); }
public void SetKey(ColumnRegistration[] registrations) { if (registrations is null) { throw new ArgumentNullException(nameof(registrations)); } LongByte lb = 0; for (int x = 0; x < registrations.Length; x++) { lb.SetBit(x, this.Headers.Contains(registrations[x].Header)); } this.Key = lb; }
public bool Evaluate(LongByte key) { LongByte tlb = this.Key; return((tlb & key) == 0 || key.Count < 2 || (tlb.Count > 1 && tlb.Count < key.Count)); }