Class AbstractAtomicPattern

java.lang.Object
fr.inria.rules.integraal.model.data.readable.query.AbstractAtomicPattern
All Implemented Interfaces:
AtomicPattern
Direct Known Subclasses:
ViewImpl

public abstract class AbstractAtomicPattern extends Object implements AtomicPattern
Represents a basic pattern for querying predicates with specific constraints on term positions. This pattern defines which positions must be specified (Mandatory), which can be indexed (Indexable), and what types of terms are allowed in each position.
  • Constructor Details

    • AbstractAtomicPattern

      public AbstractAtomicPattern(Predicate predicate, Set<Integer> mandatoryPositions, Map<Integer, Class<? extends Term>> termConstraints)
      Constructs an AtomicPattern with specific constraints.
      Parameters:
      predicate - The predicate associated with this pattern.
      mandatoryPositions - A list of positions that are mandatory.
      termConstraints - A map associating positions (0-based index) with allowed term types.
  • Method Details

    • getPredicate

      public Predicate getPredicate()
      Description copied from interface: AtomicPattern
      Returns the predicate described by this pattern.
      Specified by:
      getPredicate in interface AtomicPattern
      Returns:
      The predicate associated with this pattern.
    • getTermConstraint

      public Class<? extends Term> getTermConstraint(int position)
      Description copied from interface: AtomicPattern
      Retrieves the allowed term type for a specific position.
      Specified by:
      getTermConstraint in interface AtomicPattern
      Parameters:
      position - The position to check (0-based index).
      Returns:
      The class type of the allowed term, or null if no constraint.
    • getMandatoryPositions

      public Set<Integer> getMandatoryPositions()
      Description copied from interface: AtomicPattern
      Returns the positions that must be assigned before evaluation.
      Specified by:
      getMandatoryPositions in interface AtomicPattern
      Returns:
      An unmodifiable list of positions that are mandatory.
    • hasAssignedMandatoryParameters

      public boolean hasAssignedMandatoryParameters(Map<Integer,Term> positionsAssignation)
      Description copied from interface: AtomicPattern
      Checks whether all mandatory parameters are assigned.
      Specified by:
      hasAssignedMandatoryParameters in interface AtomicPattern
      Parameters:
      positionsAssignation - the assignation of the positions
      Returns:
      true iff the mandatory parameters are assigned
    • toString

      public String toString()
      Overrides:
      toString in class Object