@Override public OperationPredicate getFunctionSymbol() { return (OperationPredicate) super.getFunctionSymbol(); }
@Override public boolean isDataFunction() { return (!(isOperation() || isAlgebraFunction() || isDataTypeFunction())); }
@Override public int hashCode() { if (rehash) { string = toString(); identifier = string.hashCode(); rehash = false; } return identifier; }
@Override public Function clone() { ArrayList<Term> copyTerms = new ArrayList<Term>(terms.size()); for (Term term: terms) { copyTerms.add(term.clone()); } FunctionalTermImpl clone = new FunctionalTermImpl(getFunctionSymbol(), copyTerms); clone.identifier = identifier; clone.string = string; clone.rehash = rehash; return clone; }
@Override public void setPredicate(Predicate predicate) { super.setPredicate(predicate); listChanged(); }
/** * 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) { super(functor); EventGeneratingList<Term> eventlist = new EventGeneratingLinkedList<Term>(); Collections.addAll(eventlist, terms); this.terms = eventlist; registerListeners(eventlist); }
@Override public Function getFunction(Predicate functor, List<Term> arguments) { if (functor instanceof OperationPredicate) { return getExpression((OperationPredicate) functor, arguments); } // Default constructor return new FunctionalTermImpl(functor, arguments); }
@Override public Function clone() { ArrayList<Term> copyTerms = new ArrayList<Term>(terms.size()); for (Term term: terms) { copyTerms.add(term.clone()); } FunctionalTermImpl clone = new FunctionalTermImpl(getFunctionSymbol(), copyTerms); clone.identifier = identifier; clone.string = string; clone.rehash = rehash; return clone; }
@Override public void setPredicate(Predicate predicate) { super.setPredicate(predicate); listChanged(); }
/** * 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) { super(functor); EventGeneratingList<Term> eventlist = new EventGeneratingLinkedList<Term>(); Collections.addAll(eventlist, terms); this.terms = eventlist; registerListeners(eventlist); }
@Override public Function getFunction(Predicate functor, Term... arguments) { if (functor instanceof OperationPredicate) { return getExpression((OperationPredicate)functor, arguments); } // Default constructor return new FunctionalTermImpl(functor, arguments); }
@Override public boolean isDataFunction() { return (!(isOperation() || isAlgebraFunction() || isDataTypeFunction())); }
@Override public boolean isDataTypeFunction() { return getFunctionSymbol() instanceof DatatypePredicate; }
@Override public void setTerm(int index, Term newTerm) { listChanged(); terms.set(index, newTerm); }
protected FunctionalTermImpl(Predicate functor, List<Term> terms) { super(functor); EventGeneratingList<Term> eventlist = new EventGeneratingLinkedList<Term>(); eventlist.addAll(terms); this.terms = eventlist; registerListeners(eventlist); }
@Override public Function getFunction(Predicate functor, List<Term> arguments) { if (isTestModeEnabled) { checkMutability(arguments); } if (functor instanceof OperationPredicate) { return getExpression((OperationPredicate) functor, arguments); } // Default constructor return new FunctionalTermImpl(functor, arguments); }
@Override public int hashCode() { if (rehash) { string = toString(); identifier = string.hashCode(); rehash = false; } return identifier; }
@Override public boolean isOperation() { return getFunctionSymbol() instanceof OperationPredicate; }
@Override public void setTerm(int index, Term newTerm) { listChanged(); terms.set(index, newTerm); }
protected FunctionalTermImpl(Predicate functor, List<Term> terms) { super(functor); EventGeneratingList<Term> eventlist = new EventGeneratingLinkedList<Term>(); eventlist.addAll(terms); this.terms = eventlist; registerListeners(eventlist); }