Exemplo n.º 1
0
        protected override void ExceptWith(bool not, SimpleFeatureValue other, bool notOther)
        {
            var otherSfv = other as SymbolicFeatureValue;

            if (otherSfv == null)
            {
                return;
            }

            if (!not && !notOther)
            {
                _flags = _flags & (~otherSfv._flags & _feature.Mask);
            }
            else if (!not)
            {
                _flags = _flags & otherSfv._flags;
            }
            else if (!notOther)
            {
                _flags = (~_flags & _feature.Mask) & (~otherSfv._flags & _feature.Mask);
            }
            else
            {
                _flags = (~_flags & _feature.Mask) & otherSfv._flags;
            }
        }
Exemplo n.º 2
0
        protected override void UnionWith(bool not, SimpleFeatureValue other, bool notOther)
        {
            var otherSfv = other as SymbolicFeatureValue;

            if (otherSfv == null)
            {
                return;
            }

            if (!not && !notOther)
            {
                _flags = _flags | otherSfv._flags;
            }
            else if (!not)
            {
                _flags = _flags | (~otherSfv._flags & _feature.Mask);
            }
            else if (!notOther)
            {
                _flags = (~_flags & _feature.Mask) | otherSfv._flags;
            }
            else
            {
                _flags = (~_flags & _feature.Mask) | (~otherSfv._flags & _feature.Mask);
            }
            SetFirst();
        }
Exemplo n.º 3
0
        protected override bool IsSupersetOf(bool not, SimpleFeatureValue other, bool notOther)
        {
            var otherSfv = other as StringFeatureValue;

            if (otherSfv == null)
            {
                return(false);
            }

            not      = not ? !Not : Not;
            notOther = notOther ? !otherSfv.Not : otherSfv.Not;

            if (!not && !notOther)
            {
                return(_values.IsSupersetOf(otherSfv._values));
            }
            if (!not)
            {
                return(false);
            }
            if (!notOther)
            {
                return(!_values.Overlaps(otherSfv._values));
            }

            return(_values.IsSubsetOf(otherSfv._values));
        }
Exemplo n.º 4
0
        protected override void ExceptWith(bool not, SimpleFeatureValue other, bool notOther)
        {
            var otherSfv = other as StringFeatureValue;

            if (otherSfv == null)
            {
                return;
            }

            not      = not ? !Not : Not;
            notOther = notOther ? !otherSfv.Not : otherSfv.Not;

            if (!not && !notOther)
            {
                Not = false;
                _values.ExceptWith(otherSfv._values);
            }
            else if (!not)
            {
                Not = false;
                _values.IntersectWith(otherSfv._values);
            }
            else if (!notOther)
            {
                Not = true;
                _values.UnionWith(otherSfv._values);
            }
            else
            {
                Not     = false;
                _values = new HashSet <string>(otherSfv._values.Except(_values));
            }
        }
Exemplo n.º 5
0
        protected override bool Overlaps(bool not, SimpleFeatureValue other, bool notOther)
        {
            var otherSfv = other as SymbolicFeatureValue;

            if (otherSfv == null)
            {
                return(false);
            }

            if (!not && !notOther)
            {
                return((_flags & otherSfv._flags) != 0);
            }
            if (!not)
            {
                return((_flags & (~otherSfv._flags & _feature.Mask)) != 0);
            }
            if (!notOther)
            {
                return(((~_flags & _feature.Mask) & otherSfv._flags) != 0);
            }
            return(((~_flags & _feature.Mask) & (~otherSfv._flags & _feature.Mask)) != 0);
        }
Exemplo n.º 6
0
        public override bool ValueEquals(SimpleFeatureValue other)
        {
            var otherSfv = other as SymbolicFeatureValue;

            return(otherSfv != null && ValueEquals(otherSfv));
        }