Class ExpressionFactories
java.lang.Object
org.projog.core.predicate.builtin.clp.ExpressionFactories
Maintains a collection of
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<PredicateKey, String> private final Map<PredicateKey, ExpressionFactory> private final KnowledgeBaseprivate final Object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExpressionFactory(PredicateKey key, String operatorClassName) Associates aExpressionFactorywith thisKnowledgeBase.private ExpressionFactoryprivate ExpressionFactoryinstantiateExpressionFactory(String className) private ExpressionFactoryorg.projog.clp.ExpressiontoExpression(Term t, Set<ClpVariable> vars)
-
Field Details
-
kb
-
lock
-
factoryClassNames
-
factoryInstances
-
-
Constructor Details
-
ExpressionFactories
-
-
Method Details
-
addExpressionFactory
Associates aExpressionFactorywith thisKnowledgeBase.- Parameters:
key- The name and arity to associate theExpressionFactorywith.operatorClassName- The class name of theExpressionFactoryto be associated withkey.- Throws:
ProjogException- if there is already aExpressionFactoryassociated with thePredicateKey
-
toExpression
-
getExpressionFactory
-
instantiateExpressionFactory
-
instantiateExpressionFactory
-