Class ExpressionFactories

java.lang.Object
org.projog.core.predicate.builtin.clp.ExpressionFactories

public final class ExpressionFactories extends Object
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.

  • Constructor Details

    • ExpressionFactories

      public ExpressionFactories(KnowledgeBase kb)
  • Method Details

    • addExpressionFactory

      public void addExpressionFactory(PredicateKey key, String operatorClassName)
      Associates a ExpressionFactory with this KnowledgeBase.
      Parameters:
      key - The name and arity to associate the ExpressionFactory with.
      operatorClassName - The class name of the ExpressionFactory to be associated with key.
      Throws:
      ProjogException - if there is already a ExpressionFactory associated with the PredicateKey
    • toExpression

      public org.projog.clp.Expression toExpression(Term t, Set<org.projog.core.predicate.builtin.clp.ClpVariable> vars)