예제 #1
0
        public TermsChain Insert(int index, ConditionSign sign, Term term)
        {
            TermsChainNode node = new TermsChainNode(sign, term);

            this.nodes.Insert(index, node);

            return(this);
        }
예제 #2
0
        public TermsChain Add(ConditionSign sign, Term term)
        {
            TermsChainNode node = new TermsChainNode(sign, term);

            this.nodes.Add(node);

            TermVariableIsInputCheck(term);

            return(this);
        }
예제 #3
0
        public TermsChain Remove(Term term)
        {
            TermsChainNode node = null;

            foreach (TermsChainNode curNode in nodes)
            {
                if (curNode.ThisTerm == term)
                {
                    node = curNode;
                }
            }

            if (node == null)
            {
                throw new TermInRuleNotFoundException("Term with name : " + term.Name + " not found");
            }

            this.nodes.Remove(node);

            return(this);
        }
예제 #4
0
        public int IndexOf(ConditionSign sign, Term term)
        {
            TermsChainNode node = new TermsChainNode(sign, term);

            return(this.nodes.IndexOf(node));
        }