/// <summary> method compiles ObjectConditions, which include NOTCE
        /// </summary>
        public override BaseJoin compileJoin(ICondition condition, int position, Rule.IRule rule)
        {
            Binding[]       binds    = getBindings(condition, rule, position);
            ObjectCondition oc       = (ObjectCondition)condition;
            BaseJoin        joinNode = null;

            //deal with the CE which is not NOT CE.
            if (!oc.Negated)
            {
                if (binds.Length > 0 && oc.HasPredicateJoin)
                {
                    joinNode = new PredicateBNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (binds.Length > 0 && oc.HasNotEqual)
                {
                    joinNode = new HashedNotEqBNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (binds.Length > 0)
                {
                    joinNode = new HashedEqBNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (binds.Length == 0)
                {
                    joinNode = new ZJBetaNode(ruleCompiler.Engine.nextNodeId());
                }
            }

            //deal with the CE which is NOT CE.
            if (oc.Negated)
            {
                if (binds.Length > 0 && oc.HasPredicateJoin)
                {
                    joinNode = new NotJoin(ruleCompiler.Engine.nextNodeId());
                }
                else if (oc.HasNotEqual)
                {
                    joinNode = new HashedNotEqNJoin(ruleCompiler.Engine.nextNodeId());
                }
                else
                {
                    joinNode = new HashedEqNJoin(ruleCompiler.Engine.nextNodeId());
                }
            }

            if (joinNode != null)
            {
                joinNode.Bindings = binds;
            }
            return(joinNode);
        }
Esempio n. 2
0
        /// <summary> method compiles ObjectConditions, which include NOTCE
        /// </summary>
        public override BaseJoin compileJoin(ICondition condition, int position, Rule.IRule rule)
        {
            Binding[] binds = getBindings(condition, rule, position);
            ObjectCondition oc = (ObjectCondition) condition;
            BaseJoin joinNode = null;
            //deal with the CE which is not NOT CE.
            if (!oc.Negated)
            {
                if (binds.Length > 0 && oc.HasPredicateJoin)
                {
                    joinNode = new PredicateBNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (binds.Length > 0 && oc.HasNotEqual)
                {
                    joinNode = new HashedNotEqBNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (binds.Length > 0)
                {
                    joinNode = new HashedEqBNode(ruleCompiler.Engine.nextNodeId());
                }
                else if (binds.Length == 0)
                {
                    joinNode = new ZJBetaNode(ruleCompiler.Engine.nextNodeId());
                }
            }

            //deal with the CE which is NOT CE.
            if (oc.Negated)
            {
                if (binds.Length > 0 && oc.HasPredicateJoin)
                {
                    joinNode = new NotJoin(ruleCompiler.Engine.nextNodeId());
                }
                else if (oc.HasNotEqual)
                {
                    joinNode = new HashedNotEqNJoin(ruleCompiler.Engine.nextNodeId());
                }
                else
                {
                    joinNode = new HashedEqNJoin(ruleCompiler.Engine.nextNodeId());
                }
            }

            if (joinNode != null)
                joinNode.Bindings = binds;
            return joinNode;
        }