public final class ExpressionFactories extends Object
ExpressionFactory
instances.
This class provides a mechanism for "plugging in" or "injecting" implementations of org.projog.clp.Expression
at runtime. This mechanism provides an easy way to configure and extend the CLP expressions supported by Projog.
Each KnowledgeBase
has at most one unique ClpExpressions
instance.
Constructor and Description |
---|
ExpressionFactories(KnowledgeBase kb) |
Modifier and Type | Method and Description |
---|---|
void |
addExpressionFactory(PredicateKey key,
String operatorClassName)
Associates a
ExpressionFactory with this KnowledgeBase . |
org.projog.clp.Expression |
toExpression(Term t,
Set<org.projog.core.predicate.builtin.clp.ClpVariable> vars) |
public ExpressionFactories(KnowledgeBase kb)
public void addExpressionFactory(PredicateKey key, String operatorClassName)
ExpressionFactory
with this KnowledgeBase
.key
- The name and arity to associate the ExpressionFactory
with.operatorClassName
- The class name of the ExpressionFactory
to be associated with key
.ProjogException
- if there is already a ExpressionFactory
associated with the PredicateKey
Copyright © 2024. All rights reserved.