Beispiel #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);
        }
Beispiel #2
0
 protected MatchClass(MatchClass copy) : base(copy)
 {
     NarrowedBy = copy.NarrowedBy;
 }