Class ExpressionFactories


  • public final class ExpressionFactories
    extends java.lang.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 Detail

      • ExpressionFactories

        public ExpressionFactories​(KnowledgeBase kb)
    • Method Detail

      • addExpressionFactory

        public void addExpressionFactory​(PredicateKey key,
                                         java.lang.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,
                                                      java.util.Set<ClpVariable> vars)
      • instantiateExpressionFactory

        private ExpressionFactory instantiateExpressionFactory​(java.lang.String className)