public TermsChain Insert(int index, ConditionSign sign, Term term) { TermsChainNode node = new TermsChainNode(sign, term); this.nodes.Insert(index, node); return(this); }
public TermsChain Add(ConditionSign sign, Term term) { TermsChainNode node = new TermsChainNode(sign, term); this.nodes.Add(node); TermVariableIsInputCheck(term); return(this); }
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); }
public int IndexOf(ConditionSign sign, Term term) { TermsChainNode node = new TermsChainNode(sign, term); return(this.nodes.IndexOf(node)); }