Interface PredicateFactory

All Superinterfaces:
fr.inria.rules.dlgpereader.builder.api.IPredicateFactory
All Known Implementing Classes:
SameObjectPredicateFactory

public interface PredicateFactory extends fr.inria.rules.dlgpereader.builder.api.IPredicateFactory
Factory to create predicates
Author:
Florent Tornil
  • Method Details

    • createOrGetPredicate

      Predicate createOrGetPredicate(String label, int arity)
      Two object created by a call to this function with the same label and arity argument must be equals according to the definition given by the Predicate implementation used
      Specified by:
      createOrGetPredicate in interface fr.inria.rules.dlgpereader.builder.api.IPredicateFactory
      Parameters:
      label - the label
      arity - the arity
      Returns:
      a predicate with the given label and arity
    • createOrGetFreshPredicate

      Predicate createOrGetFreshPredicate(int arity)
      Creates a new predicate which won't be equal to another previously created predicate.
      The label of the predicate may already exist in some rare cases
      Parameters:
      arity - the arity
      Returns:
      a fresh predicate with the given label and arity
    • forgetPredicate

      boolean forgetPredicate(String label)
      Forgets a previously created (non fresh) predicate.
      This predicate will no longer be considered as already existing in the factory.
      Parameters:
      label - the label of the previously created predicate
      Returns:
      true iff such a predicate already exists in the factory, and thus forgets it.
    • getPredicate

      Optional<Predicate> getPredicate(String label)
      Gets a previously created predicate.
      This predicate will no longer be considered as already existing in the factory.
      Parameters:
      label - the label of the previously created predicate
      Returns:
      an optional that contains the predicate if there is one