Example #1
0
        public override bool Subsets(Match match)
        {
            if (match is MatchBaseType)
            {
                return(base.Subsets(match));
            }

            // BaseType can subset Class match based on learnt strings, while respecting narrowing.
            if (match is MatchClass)
            {
                MatchClass clazz = match as MatchClass;

                // If Class match is narrowed by BaseType, perform BaseType vs. BaseType narrowing the Class subset test.
                if (clazz.NarrowedBy != null && !base.Subsets(clazz.NarrowedBy))
                {
                    return(false);
                }

                // BaseType match subsets Class match, if all its strings are defined in BaseTypesOfClass for Class match.
                if (clazz.Contains(this))
                {
                    return(true);
                }
            }

            return(false);
        }
Example #2
0
        public override bool Subsets(Match match)
        {
            if (match is MatchBaseType)
            {
                return(base.Subsets(match));
            }

            if (match is MatchClass)
            {
                // BaseType matche subsets Class match, if all its strings are defined in BaseType list of Class match.
                MatchClass clazz = match as MatchClass;
                if (clazz.BaseTypes != null)
                {
                    foreach (string str in Values)
                    {
                        if (!clazz.BaseTypes.Contains(str))
                        {
                            return(false);
                        }
                    }

                    return(true);
                }
            }

            return(false);
        }
Example #3
0
 protected MatchClass(MatchClass copy)
     : base(copy)
 {
     if (copy.BaseTypes != null)
     {
         BaseTypes = new List <string>(copy.BaseTypes);
     }
 }
Example #4
0
 protected MatchClass(MatchClass copy) : base(copy)
 {
     NarrowedBy = copy.NarrowedBy;
 }
Example #5
0
 protected MatchClass(MatchClass copy)
     : base(copy)
 {
     if (copy.BaseTypes != null)
         BaseTypes = new List<string>(copy.BaseTypes);
 }