/** * The default constructor. * * @param functor * the function symbol name. It is defined the same as a * predicate. * @param terms * the list of arguments. */ protected FunctionalTermImpl(Predicate functor, Term... terms) { this.functor = functor; EventGeneratingList<Term> eventlist = new EventGeneratingLinkedList<Term>(); Collections.addAll(eventlist, terms); this.terms = eventlist; registerListeners(eventlist); }
protected FunctionalTermImpl(Predicate functor, List<Term> terms) { this.functor = functor; EventGeneratingList<Term> eventlist = new EventGeneratingLinkedList<Term>(); eventlist.addAll(terms); this.terms = eventlist; registerListeners(eventlist); }
protected CQIEImpl(Function head, Function[] body) { // The syntax for CQ may contain no body, thus, this condition will // check whether the construction of the link list is possible or not. if (body != null) { EventGeneratingList<Function> eventbody = new EventGeneratingLinkedList<Function>(); Collections.addAll(eventbody, body); this.body = eventbody; registerListeners(eventbody); // TODO possible memory leak!!! we should also de-register when objects are removed } // The syntax for CQ may also contain no head, thus, this condition // will check whether we can look for the head terms or not. if (head != null) { this.head = head; EventGeneratingList<Term> headterms = (EventGeneratingList<Term>) head.getTerms(); headterms.addListener(this); } }
protected CQIEImpl(Function head, List<Function> body) { // The syntax for CQ may contain no body, thus, this condition will // check whether the construction of the link list is possible or not. if (body != null) { EventGeneratingList<Function> eventbody = new EventGeneratingLinkedList<Function>(); eventbody.addAll(body); this.body = eventbody; registerListeners(eventbody); // TODO possible memory leak!!! we should also de-register when objects are removed } // The syntax for CQ may also contain no head, thus, this condition // will check whether we can look for the head terms or not. if (head != null) { this.head = head; EventGeneratingList<Term> headterms = (EventGeneratingList<Term>) head.getTerms(); headterms.addListener(this); } }